Skip to content

Instantly share code, notes, and snippets.

Last active August 10, 2016 18:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
FROM node:5.11.1
RUN mkdir -p /home/nodejs && \
groupadd -r nodejs && \
useradd -r -g nodejs -d /home/nodejs -s /sbin/nologin nodejs && \
chown -R nodejs:nodejs /home/nodejs && \
mkdir -p /voyager/app && \
chown -R nodejs:nodejs /voyager/app && \
npm install -g nodemon
# add NPM packages, typescript & typings configs
COPY package.json /voyager/app/
# copy node_modules... can't use NPM install because package references
# to private repos aren't accessible within container
COPY node_modules /voyager/app/node_modules
# copy transpiled JS => app
COPY dist /voyager/app/dist
# change the working directory to the app's folder
WORKDIR /voyager/app
# set user to nodejs & run
USER nodejs
CMD npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment