-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 720 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM alpine:3.5
# install node
RUN apk add --no-cache nodejs=6.9.2-r1 tini
# set working directory
WORKDIR /app
# copy project file
COPY package.json .
# Build time argument to set NODE_ENV ('production'' by default)
ARG NODE_ENV
ENV NODE_ENV ${NODE_ENV:-production}
# install node packages
RUN apk add --no-cache --virtual .build-dep git && \
npm set progress=false && \
npm config set depth 0 && \
npm install && \
npm cache clean && \
apk del .build-dep && \
rm -rf /tmp/*
# Set tini as entrypoint
COPY . .
# Set tini as entrypoint
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["node", "node_modules/.bin/forever", "--minUptime", "1", "--spinSleepTime", "1000", "-c", "node", "lib/index.js"]