Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Last active March 30, 2020 00:09
Show Gist options
  • Save tennisonchan/efffc7cd6ef9dd035fffa6806e5393ed to your computer and use it in GitHub Desktop.
Save tennisonchan/efffc7cd6ef9dd035fffa6806e5393ed to your computer and use it in GitHub Desktop.
# from the node 10 image
FROM node:10
# set the working dir
WORKDIR /usr/src/app
# define the env variables port and host
ENV PORT 8080
ENV HOST 0.0.0.0
# copy the package*.json to the working dir
COPY package*.json ./
# run npm install
RUN npm install --only=production
# copy source code to the working dir
COPY . .
# run npm build
RUN npm run build
# run npm start at PORT
CMD npm start -- -p ${PORT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment