Skip to content

Commit

Permalink
forward system signals to the node process using tini
Browse files Browse the repository at this point in the history
npm run doesn’t handle signal forwarding and crashes
on the SIGTERM signal sent by Kubernetes.

Tini spawns a process at PID 1 that handles forwarding
system signals to all it's child processes.

Issur: BB-459
  • Loading branch information
Kerkesni committed Oct 19, 2023
1 parent 02d0b64 commit fda2395
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ FROM node:${NODE_VERSION}
RUN apt-get update && \
apt-get install -y --no-install-recommends \
jq \
tini \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app
Expand All @@ -49,6 +50,6 @@ COPY . /usr/src/app
COPY --from=builder /usr/src/app/node_modules ./node_modules/
COPY --from=builder /usr/local/bin/dockerize /usr/local/bin/

ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
ENTRYPOINT ["tini", "--", "/usr/src/app/docker-entrypoint.sh"]

EXPOSE 8900

0 comments on commit fda2395

Please sign in to comment.