Commit 78fdd011 authored by Manuel's avatar Manuel

removed unneccessary Dockerfile

parent 13dd065e
...@@ -17,6 +17,7 @@ LOGGER = logging.getLogger(__name__) ...@@ -17,6 +17,7 @@ LOGGER = logging.getLogger(__name__)
import connexion import connexion
from security import swagger_util from security import swagger_util
from env_info import is_running_locally, get_resources_path from env_info import is_running_locally, get_resources_path
import env_info
from flask import request from flask import request
from flask import redirect from flask import redirect
...@@ -37,18 +38,24 @@ def before_request(): ...@@ -37,18 +38,24 @@ def before_request():
def api_root(): def api_root():
return redirect('/api/ui') return redirect('/api/ui')
# SSL configuration
certificate_path = get_resources_path()
context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files
if is_running_locally(): if not env_info.is_running_locally():
print("Running locally...") swagger_path = "configs/swagger.yml"
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger_local.yml")),
resolver = connexion.RestyResolver("cms_rest_api")) # SSL configuration
certificate_path = env_info.get_resources_path()
context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files
else: else:
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger.yml")), print("Running locally...")
swagger_path = "configs/swagger_local.yml"
context = None
app.add_api(swagger_util.get_bundled_specs(Path(swagger_path)),
resolver = connexion.RestyResolver("cms_rest_api")) resolver = connexion.RestyResolver("cms_rest_api"))
# start app # start app
if __name__ == '__main__': if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True, use_reloader=False, ssl_context=context) # disable reloader so only subscribed once to rabbitmq app.run(host='0.0.0.0', port=5000, ssl_context=context, debug=True)
FROM nginx:1.15.8
RUN rm /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/
RUN rm /etc/nginx/conf.d/default.conf
COPY project.conf /etc/nginx/conf.d/
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment