-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 787 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 787 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 node:8.6.0-alpine
ENV APP_KEY $APP_KEY
ENV JWT_SECRET $JWT_SECRET
ENV ALINODE_APPID $ALINODE_APPID
ENV ALINODE_SECRET $ALINODE_SECRET
RUN apk --update add tzdata \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# add npm package
COPY package.json /usr/src/app/package.json
RUN npm i --registry=https://registry.npm.taobao.org
# copy code
COPY . /usr/src/app
EXPOSE 7001
## Add the wait script to the image
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.5.0/wait /wait
RUN chmod +x /wait
CMD /wait && APP_KEY=${APP_KEY} JWT_SECRET=${JWT_SECRET} ALINODE_APPID=${ALINODE_APPID} ALINODE_SECRET=${ALINODE_SECRET} npm start