From a36634ec3caf937e4f5b99e4b8e7a8d9af1f0bf6 Mon Sep 17 00:00:00 2001 From: Catherine Pitt <cen1001@cam.ac.uk> Date: Fri, 5 May 2023 14:49:16 +0100 Subject: [PATCH] Improve dockerfile shutdown By execing python3 rather than running it as a child of /bin/sh shutdown becomes a lot faster because then the SIGTERM gets seen by the python process; when /bin/sh is the CMD and is signalled it doesn't pass the signal on to its child python process, and Docker then waits for 10 seconds before sending a SIGKILL. --- Dockerfiles/ubuntu-20.04/focal-flask | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfiles/ubuntu-20.04/focal-flask b/Dockerfiles/ubuntu-20.04/focal-flask index 16c63cf..e668819 100644 --- a/Dockerfiles/ubuntu-20.04/focal-flask +++ b/Dockerfiles/ubuntu-20.04/focal-flask @@ -35,4 +35,4 @@ RUN git archive --format=tar.gz -o /tmp/pl.tgz HEAD RUN tar -C /var/www/html -x -f /tmp/pl.tgz WORKDIR /code ENV CRSID=${CRSID} -CMD python3 rundebug.py $CRSID +CMD exec python3 rundebug.py $CRSID -- GitLab