Skip to content

Commit b06779c

Browse files
authored
Merge pull request #7 from giiska/patch-1
完善 Dockerfile
2 parents 207cfb0 + b9e9d2d commit b06779c

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
FROM library/node:lts-alpine
22

3-
COPY . /app
3+
# 设置时区
4+
ENV TIME_ZONE=Asia/Shanghai
5+
6+
RUN \
7+
echo "${TIME_ZONE}" > /etc/timezone \
8+
&& ln -sf /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime
9+
410
WORKDIR /app
511

6-
RUN cd /app && \
7-
npm i --production
12+
COPY package.json package-lock.json
13+
14+
RUN \
15+
npm config set registry https://registry.npmmirror.com/ \
16+
&& npm i --no-audit --no-fund --production
17+
18+
EXPOSE 7001
19+
20+
COPY . /app
821

922
CMD ["npm", "start"]

0 commit comments

Comments
 (0)