Skip to content

Instantly share code, notes, and snippets.

@mousetree
Created July 10, 2018 13:22
Show Gist options
  • Save mousetree/d55ba7ee566d6bd6214a5c4b05b1f172 to your computer and use it in GitHub Desktop.
Save mousetree/d55ba7ee566d6bd6214a5c4b05b1f172 to your computer and use it in GitHub Desktop.
Node.js Dockerfile (Basic)
FROM node:10
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
# At this point we just have the package.json files
RUN npm install
# Bundle app source
COPY . .
# Run any other build steps such as `npm run build`
EXPOSE 3000
CMD [ "npm", "start" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment