Skip to content

Instantly share code, notes, and snippets.

@oxlb
Created February 17, 2022 13:20
Show Gist options
  • Save oxlb/3812c64835659e7592ab7453849b4e19 to your computer and use it in GitHub Desktop.
Save oxlb/3812c64835659e7592ab7453849b4e19 to your computer and use it in GitHub Desktop.
Dockerfile for Node JS Article
# 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