Skip to content

Instantly share code, notes, and snippets.

@caeb92
Created July 14, 2020 04:38
Show Gist options
  • Save caeb92/a5274e43c60080e72de724ba681c02c4 to your computer and use it in GitHub Desktop.
Save caeb92/a5274e43c60080e72de724ba681c02c4 to your computer and use it in GitHub Desktop.
Dockerfile nodejs
FROM node:12-alpine
RUN mkdir /home/node/app/ && chown -R node:node /home/node/app
WORKDIR /home/node/app
COPY --chown=node:node package*.json ./
USER node
RUN npm install --loglevel=error
COPY --chown=node:node server.js .
COPY --chown=node:node lib ./lib/
EXPOSE 8080
CMD [ "node", "server.js" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment