From e30919ecd00063191c31dddfa420b8f3500470f2 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Wed, 3 Apr 2024 12:34:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(docker)=20switch=20CMD=20form=20fr?= =?UTF-8?q?om=20Shell=20to=20Exec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `backend-development` and `backend-production` CMD syntaxes were using a Shell Form. Shell form prevented Unix signals from reaching our container correctly, such as SIGTERM. Also, the shell process ends up being the PID 1, instead of our Python scripts. Docker recommends to use the exec form whenever possible. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 86f0e9666..7a5a14d73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -136,4 +136,4 @@ COPY --from=link-collector ${IMPRESS_STATIC_ROOT} ${IMPRESS_STATIC_ROOT} COPY --from=mail-builder /mail/backend/core/templates/mail /app/core/templates/mail # The default command runs gunicorn WSGI server in impress's main module -CMD gunicorn -c /usr/local/etc/gunicorn/impress.py impress.wsgi:application +CMD ["gunicorn", "-c", "/usr/local/etc/gunicorn/impress.py", "impress.wsgi:application"]