From 498ed385e3c8dde50e97cd6cc7fcc1afe5d698ca Mon Sep 17 00:00:00 2001 From: Aaro Koivukangas Date: Sun, 10 Mar 2024 17:20:21 +0200 Subject: [PATCH] added dumb-init for better signal handling --- backend/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/Dockerfile b/backend/Dockerfile index 786aa35..1b0fcb8 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -3,6 +3,8 @@ FROM node as builder # Create app directory WORKDIR /usr/src/app +RUN apt update -y && apt upgrade -y && apt install -y dumb-init + # Install app dependencies COPY package.json yarn.lock ./ @@ -26,6 +28,8 @@ COPY package.json yarn.lock ./ RUN yarn install --production --frozen-lockfile COPY --from=builder /usr/src/app/dist ./dist +COPY --from=builder /usr/bin/dumb-init /usr/bin/dumb-init EXPOSE 8080 +ENTRYPOINT [ "dumb-init", "--" ] CMD [ "node", "dist/index.js" ]