From e8ef87d207957687d955c6dfb6df9c359784c3cb Mon Sep 17 00:00:00 2001 From: Trevor Richards Date: Wed, 24 Jul 2024 16:26:11 -0700 Subject: [PATCH] fix?: use tini to reap chrome subprocesses Also calls node directly as the entrypoint command, and avoids the use of npm as a runtime dependency --- backend/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 775ef1a8..0a0ba3ce 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -13,7 +13,8 @@ RUN npm ci COPY . /opt/app-root/src RUN apk upgrade --no-cache --available \ - && apk add --no-cache chromium-swiftshader nss freetype harfbuzz ca-certificates ttf-freefont ghostscript + && apk add --no-cache chromium-swiftshader nss freetype \ + harfbuzz ca-certificates ttf-freefont tini ghostscript ENV CHROME_BIN=/usr/bin/chromium-browser \ CHROME_PATH=/usr/lib/chromium/ \ @@ -25,4 +26,5 @@ RUN mkdir -p /tmp/npm \ && chmod -R 777 /tmp/npm EXPOSE 443 8080 -CMD ["npm", "start"] +ENTRYPOINT ["/sbin/tini", "--"] +CMD ["node" "--max-old-space-size=450" "./src/server.js"]