Skip to content

Instantly share code, notes, and snippets.

@deven96
Created August 10, 2021 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deven96/86d9e6d1bce40202dc5e19c131fdd037 to your computer and use it in GitHub Desktop.
Save deven96/86d9e6d1bce40202dc5e19c131fdd037 to your computer and use it in GitHub Desktop.
A better Dockerfile
# pull official base image
FROM node:13.12.0-alpine
# set working directory to /app
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# copy package files to /app and install
COPY package.json ./
COPY package-lock.json ./
RUN npm install --silent
# copy rest of project to /app
COPY project/ ./
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment