Skip to content

Commit

Permalink
run as user
Browse files Browse the repository at this point in the history
  • Loading branch information
makemek committed Apr 22, 2017
1 parent 2ae0294 commit 80dfba4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ FROM node:6-alpine

LABEL maintainer "Apipol Niyomsak"

ARG PORT
ENV PORT=${PORT} \
DEPLOY_DIR=/var/www/modcolle
ENV PORT=5000 \
DEPLOY_DIR=/var/www/modcolle \
USER=www

WORKDIR ${DEPLOY_DIR}
ADD . ${DEPLOY_DIR}

RUN adduser -S $USER && \
chown -R $USER \
$DEPLOY_DIR \
/usr/local/lib \
/usr/local/bin

USER ${USER}
WORKDIR ${DEPLOY_DIR}
RUN npm install --only=production -g pm2 && \
npm install && \
npm run build
Expand Down

0 comments on commit 80dfba4

Please sign in to comment.