Skip to content

Instantly share code, notes, and snippets.

@jwdevantier
Created April 11, 2017 18:00
Show Gist options
  • Save jwdevantier/9e51c7b330c50095c1639404f0b9e5ab to your computer and use it in GitHub Desktop.
Save jwdevantier/9e51c7b330c50095c1639404f0b9e5ab to your computer and use it in GitHub Desktop.
Example dockerfile
# 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