feat: serve app with gunicorn
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
# The .dockerignore file ensures we only include what's specified
|
# The .dockerignore file ensures we only include what's specified
|
||||||
COPY musicround/ ./musicround/
|
COPY musicround/ ./musicround/
|
||||||
COPY migrations/ ./migrations/
|
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
|
# Make the entrypoint script executable
|
||||||
RUN chmod +x docker-entrypoint.sh
|
RUN chmod +x 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
|
exec python -m flask run --host=0.0.0.0 --port=5000 --reload --debug
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Starting Flask application server..."
|
: "${GUNICORN_BIND:=0.0.0.0:5000}"
|
||||||
exec python run.py
|
: "${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
|
esac
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ Flask-Mail
|
|||||||
Flask-Session
|
Flask-Session
|
||||||
authlib>=1.6.5
|
authlib>=1.6.5
|
||||||
Flask-Caching
|
Flask-Caching
|
||||||
|
gunicorn
|
||||||
psutil
|
psutil
|
||||||
|
|
||||||
# Testing dependencies
|
# Testing dependencies
|
||||||
|
|||||||
Reference in New Issue
Block a user