Created
April 11, 2017 18:00
-
-
Save jwdevantier/9e51c7b330c50095c1639404f0b9e5ab to your computer and use it in GitHub Desktop.
Example dockerfile
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
# Use an official, pre-rolled node image | |
# https://hub.docker.com/_/node/ | |
FROM node:7.8.0 | |
# Some variales which we can set when building the image... | |
ARG SRCDIR=src | |
RUN mkdir -p /opt/app | |
WORKDIR /opt/app | |
# configure your app to bind to 8080 - don't worry, | |
# this is internal to the container - the actual port on the server | |
# hosting the app can be mapped however you want. | |
EXPOSE 8080 | |
CMD ["npm" "start"] | |
# copies all files from 'src' dir into '/opt/app' - Do *NOT* append a star | |
COPY $SRCDIR/ /opt/app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment