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

Commit

Permalink
fix(server): handle kernel signals by including tini (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
PixnBits authored Apr 19, 2024
1 parent a07372c commit f9b13e5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ RUN NODE_ENV=production npm run build && \
mv /opt/build/bundle.integrity.manifest.json /opt/one-app/production && \
mv /opt/build/.build-meta.json /opt/one-app/production

# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals
FROM node:$VERSION-alpine as node-tini
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]

# development image
# docker build . --target=development
FROM node:$VERSION-alpine as development
FROM node-tini as development
ARG USER
ENV USER ${USER:-node}
ENV NODE_ENV=development
Expand All @@ -49,7 +54,7 @@ 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
FROM node-tini as production
ARG USER
ENV USER ${USER:-node}
ENV NODE_ENV=production
Expand Down

0 comments on commit f9b13e5

Please sign in to comment.