feat: serve app with gunicorn
This commit is contained in:
+2
-2
@@ -18,7 +18,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
# The .dockerignore file ensures we only include what's specified
|
||||
COPY musicround/ ./musicround/
|
||||
COPY migrations/ ./migrations/
|
||||
COPY run_migration.py run.py docker-entrypoint.sh LICENSE favicon.ico .
|
||||
COPY run_migration.py run.py wsgi.py docker-entrypoint.sh LICENSE favicon.ico .
|
||||
|
||||
# Make the entrypoint script executable
|
||||
RUN chmod +x docker-entrypoint.sh
|
||||
@@ -31,4 +31,4 @@ ENV PYTHONPATH=/app
|
||||
ENV FLASK_APP=run.py
|
||||
|
||||
# Use the entrypoint script
|
||||
CMD ["./docker-entrypoint.sh"]
|
||||
CMD ["./docker-entrypoint.sh"]
|
||||
|
||||
+13
-2
@@ -23,7 +23,18 @@ case "${FLASK_DEBUG,,}" in
|
||||
exec python -m flask run --host=0.0.0.0 --port=5000 --reload --debug
|
||||
;;
|
||||
*)
|
||||
echo "Starting Flask application server..."
|
||||
exec python run.py
|
||||
: "${GUNICORN_BIND:=0.0.0.0:5000}"
|
||||
: "${GUNICORN_WORKERS:=2}"
|
||||
: "${GUNICORN_THREADS:=4}"
|
||||
: "${GUNICORN_TIMEOUT:=120}"
|
||||
echo "Starting Gunicorn application server..."
|
||||
exec gunicorn \
|
||||
--bind "$GUNICORN_BIND" \
|
||||
--workers "$GUNICORN_WORKERS" \
|
||||
--threads "$GUNICORN_THREADS" \
|
||||
--timeout "$GUNICORN_TIMEOUT" \
|
||||
--access-logfile - \
|
||||
--error-logfile - \
|
||||
wsgi:app
|
||||
;;
|
||||
esac
|
||||
|
||||
+2
-1
@@ -17,9 +17,10 @@ Flask-Mail
|
||||
Flask-Session
|
||||
authlib>=1.6.5
|
||||
Flask-Caching
|
||||
gunicorn
|
||||
psutil
|
||||
|
||||
# Testing dependencies
|
||||
pytest>=7.4.0
|
||||
pytest-cov>=4.1.0
|
||||
pytest-flask>=1.2.0
|
||||
pytest-flask>=1.2.0
|
||||
|
||||
Reference in New Issue
Block a user