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 | |
EXPOSE 8080 | |
# 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