Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

fix(server): handle kernel signals by including tini #1387

Merged
merged 5 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ RUN NODE_ENV=production npm run build && \
# development image
# docker build . --target=development
FROM node:$VERSION-alpine as development
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals
RUN apk add --no-cache tini
PixnBits marked this conversation as resolved.
Show resolved Hide resolved
ARG USER
ENV USER ${USER:-node}
ENV NODE_ENV=development
Expand All @@ -50,6 +52,8 @@ COPY --from=builder --chown=node:node /opt/one-app/development ./
# production image
# last so that it's the default image artifact
FROM node:$VERSION-alpine as production
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals
RUN apk add --no-cache tini
ARG USER
ENV USER ${USER:-node}
ENV NODE_ENV=production
Expand Down
4 changes: 2 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ done

commandArgs="$nodeArgs lib/server/index.js $flags"

echo "node $commandArgs"
exec node $commandArgs
echo "/sbin/tini -- node $commandArgs"
exec /sbin/tini -- node $commandArgs
Loading