Skip to content

Instantly share code, notes, and snippets.

@keidrun
Created May 18, 2019 08:40
Show Gist options
  • Save keidrun/10df5ae05c10c30e9b9593e7a9b94ccf to your computer and use it in GitHub Desktop.
Save keidrun/10df5ae05c10c30e9b9593e7a9b94ccf to your computer and use it in GitHub Desktop.
How to add tini to a dockerized NodeJS app
FROM node:12.2-alpine
ENV NODE_ENV=production
RUN apk add --no-cache tini
WORKDIR /node
COPY package.json yarn.lock ./
RUN mkdir app && chown -R node:node .
USER node
RUN yarn install && yarn cache clean --force
WORKDIR /node/app
COPY --chown=node:node . .
EXPOSE 3000
ENTRYPOINT ["/sbin/tini", "-e", "143", "--"]
CMD ["node", "app.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment