Created
March 30, 2018 17:10
-
-
Save pacroy/acd24c7c99ac9dd76f08adf809720a82 to your computer and use it in GitHub Desktop.
This file contains 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
# Instructions from the app developer | |
# - you should use the 'node' official image, with the alpine 6.x branch | |
FROM node:6-alpine | |
# - this app listens on port 3000, but the container should launch on port 80 | |
# so it will respond to http://localhost:80 on your computer | |
EXPOSE 3000 | |
# - then it should use alpine package manager to install tini: 'apk add --update tini' | |
# - then it should create directory /usr/src/app for app files with 'mkdir -p /usr/src/app' | |
RUN apk add --update tini && \ | |
mkdir -p /usr/src/app | |
WORKDIR /usr/src/app | |
# - Node uses a "package manager", so it needs to copy in package.json file | |
COPY package.json package.json | |
# - then it needs to run 'npm install' to install dependencies from that file | |
# - to keep it clean and small, run 'npm cache clean --force' after above | |
RUN npm install && npm cache clean --force | |
# - then it needs to copy in all files from current directory | |
COPY . . | |
# - then it needs to start container with command 'tini -- node ./bin/www' | |
# - in the end you should be using FROM, RUN, WORKDIR, COPY, EXPOSE, and CMD commands | |
CMD [ "tini", "--", "node", "./bin/www" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment