diff --git a/labapp/Dockerfile b/labapp/Dockerfile index 63eff13..68ef0a6 100644 --- a/labapp/Dockerfile +++ b/labapp/Dockerfile @@ -6,8 +6,5 @@ WORKDIR /app COPY app . RUN pip install --no-cache-dir -r requirements.txt -EXPOSE 5000 -ENV FLASK_APP app.py -ENV FLASK_RUN_HOST 0.0.0.0 - -CMD ["flask", "run", "--host=0.0.0.0"] +EXPOSE 8080 +CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"] diff --git a/labapp/app/__init__.py b/labapp/app/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/labapp/app/__init__.py @@ -0,0 +1 @@ + diff --git a/labapp/app/app.py b/labapp/app/app.py index 2146682..18c3838 100644 --- a/labapp/app/app.py +++ b/labapp/app/app.py @@ -10,7 +10,7 @@ from ce import get_ce_info, get_ce_state app = Flask(__name__) -app.config['udf'] = os.getenv('UDF', False) +app.config['udf'] = os.getenv('UDF', None) info = None if app.config['udf']: info = get_ce_info() @@ -141,6 +141,6 @@ def lb_azure(): return jsonify(status='success', data=response.json()) except requests.RequestException as e: return jsonify(status='fail', error=str(e)) - + if __name__ == '__main__': - app.run(debug=False) \ No newline at end of file + app.run(host='0.0.0.0', port=5001, debug=False) \ No newline at end of file diff --git a/labapp/app/requirements.txt b/labapp/app/requirements.txt index a7620cc..7c54f96 100644 --- a/labapp/app/requirements.txt +++ b/labapp/app/requirements.txt @@ -4,4 +4,5 @@ Markdown ~=3.6 validators ~=0.28.1 boto3 ~=1.34.92 pyYAML ~=6.0.1 -Flask-Caching ~=2.1.0 \ No newline at end of file +Flask-Caching ~=2.1.0 +gunicorn ~=22.0.0 \ No newline at end of file