Created
February 16, 2021 20:42
-
-
Save DEALTALFA/86d538e5ff470dd0a45788ab8144ad21 to your computer and use it in GitHub Desktop.
make a docker image for nodejs project
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 node:latest #FROM to tell which base os to use | |
ENV NODE_ENV=production # make it productive | |
WORKDIR /app # telling Working directory where where the command should this is now the root directory | |
COPY ["package.json", "package-lock.json*", "./"] #copyied this file | |
RUN npm install -g create-react-app #npm dependencies | |
RUN npm install #update | |
COPY project/ . #many file so put in folder then copied insider to root i.e /app | |
EXPOSE 3000 #exposed the 3000 port | |
CMD [ "npm", "start" ] #started the server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment