Skip to content

Instantly share code, notes, and snippets.

@jerryvig
Created July 3, 2020 07:37
Show Gist options
  • Save jerryvig/72cce68eef5f42b8c188fb34726e1c2c to your computer and use it in GitHub Desktop.
Save jerryvig/72cce68eef5f42b8c188fb34726e1c2c to your computer and use it in GitHub Desktop.
NodeJS - Example Dockerfile
FROM node:12.18.2-buster-slim
# 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 ./
RUN npm install
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . .
EXPOSE 8080
CMD [ "node", "index.js" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment