Skip to content

Commit de0ac7e

Browse files
committed
fix: manage properly os signals from shell
1 parent cffd9e4 commit de0ac7e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ USER root
2222
RUN apt-get update && apt-get install -y \
2323
"chromium" \
2424
"curl" \
25+
"dumb-init" \
2526
"git" \
2627
"pandoc" \
2728
"python3-pip=${PIP_VERSION}" \
@@ -37,6 +38,9 @@ ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH="${CHROME_BIN}"
3738
# This one is required by Wappalyzer to launch the browser (ref: `node_modules/wappalyzer/driver.js`)
3839
ENV CHROMIUM_BIN="${CHROME_BIN}"
3940

41+
# Cache "npx" dependencies to start faster
42+
RUN npm install -g "prisma@${PRISMA_VERSION}"
43+
4044
# Restrict the permissions
4145

4246
RUN addgroup --system --gid 800 nodejs
@@ -82,5 +86,8 @@ ENV APP_HOST $APP_HOST
8286
ENV PORT $PORT
8387
EXPOSE $PORT
8488

89+
# Needed to handle signals properly (due to PID 1)
90+
ENTRYPOINT ["dumb-init", "--"]
91+
8592
# We use `npx` to avoid using `npm run db:migration:deploy:unsecure` since we build as standalone the entire application and we no longer want to rely application `node_modules` folder
86-
CMD npx --yes prisma@${PRISMA_VERSION} migrate deploy && ./start-and-wait-to-init.sh
93+
CMD ["bash", "-c", "npx --yes prisma@${PRISMA_VERSION} migrate deploy && exec ./start-and-wait-to-init.sh"]

0 commit comments

Comments
 (0)