Skip to content

Instantly share code, notes, and snippets.

@boltathi24
Created July 27, 2021 18:00
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 boltathi24/f0e30e2bbe54fdf632444408e7c2fb96 to your computer and use it in GitHub Desktop.
Save boltathi24/f0e30e2bbe54fdf632444408e7c2fb96 to your computer and use it in GitHub Desktop.
DockerFile for Express Api
# pull official base image
FROM node:13.12.0-alpine
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install
# add app
COPY . ./
# start app express app
CMD ["node", "index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment