Skip to content

Instantly share code, notes, and snippets.

@mattkime
Created July 21, 2016 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattkime/387acee42ac494910060f6f20eea86d9 to your computer and use it in GitHub Desktop.
Save mattkime/387acee42ac494910060f6f20eea86d9 to your computer and use it in GitHub Desktop.
FROM node:6
RUN useradd --user-group --create-home --shell /bin/false mup
# copy app code to container
WORKDIR /home/mup/mup-web
COPY . /home/mup/mup-web
RUN chown -R mup:mup /home/mup/mup-web
USER mup
ENV API_PROTOCOL=https
ENV DEV_SERVER_PORT=8000
ENV NODE_PATH=/home/mup/node_modules
ENV PATH=/home/mup/node_modules/.bin/:$PATH
# cache builds
# only rebuild if package.json has changed
WORKDIR /home/mup/
COPY package.json /home/mup/package.json
RUN npm install --only=prod
EXPOSE 8000
WORKDIR /home/mup/mup-web
CMD npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment