Skip to content

Instantly share code, notes, and snippets.

@bbachi
Created February 14, 2019 07:15
Show Gist options
  • Select an option

  • Save bbachi/2078e0bb2c1540e241499730d36a2d4f to your computer and use it in GitHub Desktop.

Select an option

Save bbachi/2078e0bb2c1540e241499730d36a2d4f to your computer and use it in GitHub Desktop.
Containerize your Node.js Rest API and run it on Docker v2
# from base image node
FROM node:8.11-slim
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# copy oter files as well
COPY dist/api.bundle.js .
#expose the port
EXPOSE 3070
# command to run when intantiate an image
CMD ["node","api.bundle.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment