Skip to content

Instantly share code, notes, and snippets.

@bbachi
Last active February 13, 2019 22:53
Show Gist options
  • Select an option

  • Save bbachi/3de48b34dbecec4109771812974aa44d to your computer and use it in GitHub Desktop.

Select an option

Save bbachi/3de48b34dbecec4109771812974aa44d to your computer and use it in GitHub Desktop.
Containarize your Node.js Rest API - Javascript verison
# from base image node
FROM node:8.11-slim
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 oter files as well
COPY ./ .
#expose the port
EXPOSE 3070
# command to run 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