From 16b763e086ef23136b31b44daa78516ca589949a Mon Sep 17 00:00:00 2001 From: bt90 Date: Thu, 29 Dec 2022 21:49:02 +0100 Subject: [PATCH] fix(docker-build): start main process with exec (#1210) * Use exec * Appl shellcheck fixes * Close with newline --- machine-learning/entrypoint.sh | 3 ++- server/start-microservices.sh | 3 ++- server/start-server.sh | 3 ++- web/entrypoint.sh | 9 +++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/machine-learning/entrypoint.sh b/machine-learning/entrypoint.sh index 33c85d83c2..020fba9f7f 100644 --- a/machine-learning/entrypoint.sh +++ b/machine-learning/entrypoint.sh @@ -1,3 +1,4 @@ +#! /bin/sh # npm run typeorm migration:run # npm run start:prod -node dist/main.js +exec node dist/main.js diff --git a/server/start-microservices.sh b/server/start-microservices.sh index d76065712e..153fb97cd3 100644 --- a/server/start-microservices.sh +++ b/server/start-microservices.sh @@ -1 +1,2 @@ -node dist/apps/microservices/apps/microservices/src/main \ No newline at end of file +#! /bin/sh +exec node dist/apps/microservices/apps/microservices/src/main diff --git a/server/start-server.sh b/server/start-server.sh index 5bbc6dd3cc..0b539f3069 100644 --- a/server/start-server.sh +++ b/server/start-server.sh @@ -1 +1,2 @@ -node dist/apps/immich/apps/immich/src/main \ No newline at end of file +#! /bin/sh +exec node dist/apps/immich/apps/immich/src/main diff --git a/web/entrypoint.sh b/web/entrypoint.sh index cabdaeb5d2..b9c9d66721 100644 --- a/web/entrypoint.sh +++ b/web/entrypoint.sh @@ -1,5 +1,6 @@ -if [ `id -u` -eq 0 ] && [ -n "$PUID" ] && [ -n "$PGID" ]; then - exec setpriv --reuid $PUID --regid $PGID --clear-groups node /usr/src/app/build/index.js +#! /bin/sh +if [ "$(id -u)" -eq 0 ] && [ -n "$PUID" ] && [ -n "$PGID" ]; then + exec setpriv --reuid "$PUID" --regid "$PGID" --clear-groups node /usr/src/app/build/index.js else - node /usr/src/app/build/index.js -fi \ No newline at end of file + exec node /usr/src/app/build/index.js +fi