diff --git a/quantum_app_backend/dockerfile b/quantum_app_backend/dockerfile index a9a41be..a2e8ff1 100644 --- a/quantum_app_backend/dockerfile +++ b/quantum_app_backend/dockerfile @@ -2,8 +2,8 @@ FROM python:3.9-slim # Set environment variables -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 # Set the working directory in the container WORKDIR /app @@ -31,4 +31,4 @@ EXPOSE 3001 ENV FLASK_APP=app.py # Run the Flask app -CMD ["flask", "run", "--host=0.0.0.0", "--port=3001"] +CMD ["gunicorn","--config", "gunicorn_config.py", "app:app"] diff --git a/quantum_app_backend/gunicorn_config.py b/quantum_app_backend/gunicorn_config.py new file mode 100644 index 0000000..bd955b9 --- /dev/null +++ b/quantum_app_backend/gunicorn_config.py @@ -0,0 +1,17 @@ +import os + + + +workers = int(os.environ.get('GUNICORN_PROCESSES', '2')) + +threads = int(os.environ.get('GUNICORN_THREADS', '4')) + +# timeout = int(os.environ.get('GUNICORN_TIMEOUT', '120')) + +bind = os.environ.get('GUNICORN_BIND', '0.0.0.0:3001') + + + +forwarded_allow_ips = '*' + +secure_scheme_headers = { 'X-Forwarded-Proto': 'https' } \ No newline at end of file diff --git a/quantum_app_backend/requirements.txt b/quantum_app_backend/requirements.txt index c0f8b75..c9c3d04 100644 --- a/quantum_app_backend/requirements.txt +++ b/quantum_app_backend/requirements.txt @@ -26,4 +26,5 @@ portalocker matplotlib flask-pymongo dotenv -flask-socketio \ No newline at end of file +flask-socketio +gunicorn==23.0.0 \ No newline at end of file