From 6aa01de87c1dc973378201c16c8eafec74ff1959 Mon Sep 17 00:00:00 2001 From: LucifersCircle Date: Sat, 7 Dec 2024 13:14:26 -0800 Subject: [PATCH] Update dockerfile switch from test server --- dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dockerfile b/dockerfile index cc85ae8..647937c 100644 --- a/dockerfile +++ b/dockerfile @@ -8,10 +8,12 @@ COPY . . RUN chown -R appuser:appuser /usr/src/app -RUN pip install --no-cache-dir flask requests cryptography +RUN pip install --no-cache-dir flask requests cryptography gunicorn USER appuser -# Use an environment variable to decide which script to run -ENV APP_SCRIPT="app.py" -CMD ["sh", "-c", "python $APP_SCRIPT"] +# Environment variable to specify the script for the app +ENV APP_SCRIPT="app:app" # app is the filename, app is the Flask instance + +CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "$APP_SCRIPT"] +