From d341c45566a0d0e6ac55fe8669ae0fbe5bcf3121 Mon Sep 17 00:00:00 2001 From: "pierre-francois.duc" Date: Tue, 28 Jan 2025 21:28:20 +0100 Subject: [PATCH] Copy startup file --- .../production/app_postgres/Dockerfile | 10 ++++++++++ app/compose/production/app_postgres/start | 19 ++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/app/compose/production/app_postgres/Dockerfile b/app/compose/production/app_postgres/Dockerfile index ffea55a2..ebb4f616 100644 --- a/app/compose/production/app_postgres/Dockerfile +++ b/app/compose/production/app_postgres/Dockerfile @@ -21,8 +21,18 @@ ADD app/ ${APP_ROOT} COPY ./app/djangoq_setup.sh /djangoq_setup.sh RUN chmod +x /djangoq_setup.sh +COPY ./app/compose/production/app_postgres/start /start +#RUN sed -i 's/\r$//g' /start +RUN chmod +x /start + RUN adduser appuser --system --no-create-home --shell /bin/sh \ && chown -R appuser ${APP_ROOT} + +RUN chown appuser /start +RUN chown appuser /djangoq_setup.sh + USER appuser + + CMD ${STARTUP_COMMAND} \ No newline at end of file diff --git a/app/compose/production/app_postgres/start b/app/compose/production/app_postgres/start index 8afbf70c..440093dd 100644 --- a/app/compose/production/app_postgres/start +++ b/app/compose/production/app_postgres/start @@ -1,12 +1,9 @@ #!/bin/bash - -set -o errexit -set -o pipefail -set -o nounset - -python /app/manage.py collectstatic --noinput -python /app/manage.py migrate -python /app/manage.py update_assettype -python /app/manage.py update_valuetype -python /app/manage.py compilemessages -gunicorn epa.wsgi:application --bind 0.0.0.0:5000 --workers=4 --timeout=120 --chdir=/app \ No newline at end of file +echo COLLECTSTATIC +python /src/manage.py collectstatic --noinput +echo MIGRATE +python /src/manage.py migrate +python /src/manage.py update_assettype +python /src/manage.py update_valuetype +python /src/manage.py compilemessages +gunicorn /src/epa.wsgi:application --bind 0.0.0.0:8000 --workers=4 --timeout=120 --chdir=/src \ No newline at end of file