Skip to content

Instantly share code, notes, and snippets.

@Maurifc
Last active November 22, 2022 20:22
Show Gist options
  • Save Maurifc/32613a7354d68faff4e28310ee4e269f to your computer and use it in GitHub Desktop.
Save Maurifc/32613a7354d68faff4e28310ee4e269f to your computer and use it in GitHub Desktop.
Docker - Basic Dockerfile for NodeJS
FROM node:16-alpine
RUN mkdir $HOME/app
WORKDIR $HOME/app
COPY --chown=node:node package.json $HOME/app/
RUN npm install
COPY --chown=node:node . $HOME/app
EXPOSE 8080
USER node
CMD npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment