-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (49 loc) · 1.53 KB
/
Copy pathDockerfile
File metadata and controls
71 lines (49 loc) · 1.53 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# FROM node:8.12-alpine AS builder
# COPY package*.json /
# RUN apk update && apk add git \
# && apk add gettext \
# && npm install && mkdir /app \
# && cp -r node_modules /app/
# ARG BUILD_ENV
# ARG VERSION
# ARG DATE_VERSION
# ARG COMMIT_NO
# WORKDIR /app
# COPY . .
# RUN envsubst '${VERSION},${DATE_VERSION},${COMMIT_NO}' < ./src/assets/config/app.config.${BUILD_ENV}.json > ./src/assets/config/app.config.${BUILD_ENV}.json
# RUN $(npm bin)/ng build --configuration=${BUILD_ENV} --prod
FROM node:8-alpine
ENV TZ=Asia/Bangkok
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python
RUN npm install --quiet node-gyp -g
RUN apk add tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& npm install \
&& mkdir -p /app/ssl
ARG CONTAINER_PORT
ARG PM2_FILE
ENV PM2_FILE ${PM2_FILE}
WORKDIR /app/
COPY . /app
RUN npm install -g pm2 && npm install express express-winston winston && npm install
EXPOSE ${CONTAINER_PORT}
CMD pm2 start ${PM2_FILE} --no-daemon
#
FROM node:8-alpine
ENV TZ=Asia/Bangkok
RUN apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python
RUN npm install --quiet node-gyp -g
RUN apk add tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& npm install \
&& mkdir -p /app/ssl
ARG CONTAINER_PORT
ARG PM2_FILE
ENV PM2_FILE ${PM2_FILE}
WORKDIR /app/
COPY . /app
RUN npm install -g pm2 && npm install express express-winston winston && npm install
EXPOSE 9011
CMD pm2 start ${PM2_FILE} --no-daemon