Forked from oktavianidewi/dockerize-simple-api.md
Last active
September 12, 2019 21:11
-
-
Save shamaru001/c14708a1db54ba4201b1942a54d3fa70 to your computer and use it in GitHub Desktop.
Dockerize simple API from Node-JS
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 node:9-slim | |
# use this directory to store files, run npm, and launch our app | |
WORKDIR /app | |
# copy application to /app directory, install dependecies. | |
# If you add the package.json first and run npm install later, Docker won't have to install the dependencies again if you change package.json | |
COPY package.json /app | |
RUN npm install | |
COPY . /app | |
# what should be executed when the docker image is launched. | |
CMD node index.js | |
# expose port 8081 tok the outside once the container has launched | |
EXPOSE 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment