Skip to content

Commit

Permalink
use node alpine image (#25)
Browse files Browse the repository at this point in the history
* use node:6-apine docker image
* run as user
  • Loading branch information
makemek committed Apr 26, 2017
1 parent 15ea475 commit 44556d3
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
FROM node:6.9.1
FROM node:6-alpine

MAINTAINER Apipol Niyomsak
LABEL maintainer "Apipol Niyomsak"

RUN npm install -g pm2
ENV PORT=5000 \
DEPLOY_DIR=/var/www/modcolle \
USER=www

RUN mkdir -p /var/www/modcolle
ADD . ${DEPLOY_DIR}

# Define working directory
WORKDIR /var/www/modcolle
RUN adduser -S $USER && \
chown -R $USER \
$DEPLOY_DIR \
/usr/local/lib \
/usr/local/bin

ADD . /var/www/modcolle/
USER ${USER}
WORKDIR ${DEPLOY_DIR}
RUN npm install --only=production -g pm2 && \
npm install && \
npm run build

VOLUME ["/var/www/modcolle/log"]
EXPOSE ${PORT}

RUN npm install && npm run build

# Expose port
EXPOSE 5000

# Run app
CMD pm2-docker start process.json --auto-exit

0 comments on commit 44556d3

Please sign in to comment.