From 48768b9d537eae3000f771bdf8b4347ba38fb7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Martin?= Date: Wed, 22 Mar 2023 08:44:38 -0700 Subject: [PATCH 1/3] Use pm2-runtime to ensure quick stop (#414) --- files/enketo/start-enketo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/enketo/start-enketo.sh b/files/enketo/start-enketo.sh index b097ce40..ad13c244 100755 --- a/files/enketo/start-enketo.sh +++ b/files/enketo/start-enketo.sh @@ -12,4 +12,4 @@ envsubst '$DOMAIN $BASE_URL $SECRET $LESS_SECRET $API_KEY $SUPPORT_EMAIL' \ > "$CONFIG_PATH" echo "starting pm2/enketo.." -pm2 start --no-daemon app.js -n enketo +pm2-runtime app.js -n enketo From 6099c98fe71c2dd00afafe3e957cf6b5e350bd72 Mon Sep 17 00:00:00 2001 From: Yaw Anokwa Date: Fri, 24 Mar 2023 11:20:12 -0700 Subject: [PATCH 2/3] Upgrade node (#415) --- service.dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service.dockerfile b/service.dockerfile index 7e2034ee..3840d4c4 100644 --- a/service.dockerfile +++ b/service.dockerfile @@ -1,4 +1,5 @@ -FROM node:16.19.1 as intermediate +ARG node_version=16.19.1 +FROM node:${node_version} as intermediate COPY . . RUN mkdir /tmp/sentry-versions @@ -8,7 +9,7 @@ RUN git describe --tags --dirty > /tmp/sentry-versions/server WORKDIR ../client RUN git describe --tags --dirty > /tmp/sentry-versions/client -FROM node:16.17.0 +FROM node:${node_version} WORKDIR /usr/odk From 4b818de8cdf83365142f236f12f66a313a5fca4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9l=C3=A8ne=20Martin?= Date: Fri, 24 Mar 2023 14:40:25 -0700 Subject: [PATCH 3/3] Speed up stopping Enketo, NGINX, service containers (#417) --- enketo.dockerfile | 2 +- files/enketo/start-enketo.sh | 2 +- files/nginx/setup-odk.sh | 2 +- files/service/scripts/start-odk.sh | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/enketo.dockerfile b/enketo.dockerfile index 95a4e4b8..e83ef95b 100644 --- a/enketo.dockerfile +++ b/enketo.dockerfile @@ -19,4 +19,4 @@ RUN apt-get update && \ EXPOSE 8005 -CMD ./start-enketo.sh +CMD ["./start-enketo.sh"] diff --git a/files/enketo/start-enketo.sh b/files/enketo/start-enketo.sh index ad13c244..f4eff90d 100755 --- a/files/enketo/start-enketo.sh +++ b/files/enketo/start-enketo.sh @@ -12,4 +12,4 @@ envsubst '$DOMAIN $BASE_URL $SECRET $LESS_SECRET $API_KEY $SUPPORT_EMAIL' \ > "$CONFIG_PATH" echo "starting pm2/enketo.." -pm2-runtime app.js -n enketo +exec pm2-runtime app.js -n enketo diff --git a/files/nginx/setup-odk.sh b/files/nginx/setup-odk.sh index 7e3d3aef..8e813a1d 100644 --- a/files/nginx/setup-odk.sh +++ b/files/nginx/setup-odk.sh @@ -40,5 +40,5 @@ else perl -i -ne 'print if $. < 7 || $. > 14' /etc/nginx/conf.d/redirector.conf echo "starting nginx for custom ssl and self-signed certs..." fi - nginx -g "daemon off;" + exec nginx -g "daemon off;" fi diff --git a/files/service/scripts/start-odk.sh b/files/service/scripts/start-odk.sh index 39b44cd8..fc166c04 100755 --- a/files/service/scripts/start-odk.sh +++ b/files/service/scripts/start-odk.sh @@ -40,5 +40,4 @@ fi echo "using $WORKER_COUNT worker(s) based on available memory ($MEMTOT).." echo "starting server." -pm2-runtime ./pm2.config.js - +exec pm2-runtime ./pm2.config.js