Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use node alpine image #25

Merged
merged 2 commits into from
Apr 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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