Skip to content

Commit 8aab538

Browse files
committed
Signed-off-by: Logaxn <[email protected]>
1 parent 56bf865 commit 8aab538

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:11.10.0-alpine
1+
FROM node:11.10.0-alpine as Builder
22

33
# 由于国内网络问题,yarn run build:prod 失败
44
# 暂时通过阿里云容器镜像服务的海外机器构建功能解决
@@ -14,12 +14,16 @@ RUN yarn install
1414
RUN yarn run build:prod
1515

1616

17+
WORKDIR dist
18+
19+
RUN GZIP=-9 tar -pzcf ../dist.tgz *
1720

1821
# https://docs.docker.com/develop/develop-images/multistage-build/
1922

2023
FROM busybox
2124

22-
COPY --from=0 /app/dist /app_dist
25+
# COPY --from=0 /app/dist /app_dist
26+
COPY --from=Builder /app/dist.tgz /dist.tgz
2327

2428

2529
# git push aliyun master:master
@@ -29,3 +33,4 @@ COPY --from=0 /app/dist /app_dist
2933

3034
# 将镜像里的 /app_dist 目录拷出来
3135
# docker run --rm -v $HOME/dist:/dist registry.cn-shenzhen.aliyuncs.com/logaxn/zealouscrm-vue cp -r -T /app_dist /dist
36+
# docker run --rm -v $HOME/dist:/dist registry.cn-shenzhen.aliyuncs.com/logaxn/zealouscrm-vue tar -pzxf /dist.tgz -C /dist

0 commit comments

Comments
 (0)