Created
February 17, 2022 13:20
-
-
Save oxlb/3812c64835659e7592ab7453849b4e19 to your computer and use it in GitHub Desktop.
Dockerfile for Node JS Article
This file contains hidden or 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 base image node | |
FROM node:16 | |
# Create app directory | |
RUN mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
# Copying all the files from your file system to container file system | |
COPY package.json . | |
# Install all dependencies | |
RUN npm install | |
# Copy other files too | |
COPY ./ . | |
# Expose the port | |
EXPOSE 3030 | |
# Command to run app when intantiate an image | |
CMD ["npm","start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment