Last active
March 30, 2020 00:09
-
-
Save tennisonchan/efffc7cd6ef9dd035fffa6806e5393ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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