File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
- FROM node:11.10.0-alpine
1
+ FROM node:11.10.0-alpine as Builder
2
2
3
3
# 由于国内网络问题,yarn run build:prod 失败
4
4
# 暂时通过阿里云容器镜像服务的海外机器构建功能解决
@@ -14,12 +14,16 @@ RUN yarn install
14
14
RUN yarn run build:prod
15
15
16
16
17
+ WORKDIR dist
18
+
19
+ RUN GZIP=-9 tar -pzcf ../dist.tgz *
17
20
18
21
# https://docs.docker.com/develop/develop-images/multistage-build/
19
22
20
23
FROM busybox
21
24
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
23
27
24
28
25
29
# git push aliyun master:master
@@ -29,3 +33,4 @@ COPY --from=0 /app/dist /app_dist
29
33
30
34
# 将镜像里的 /app_dist 目录拷出来
31
35
# 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
You can’t perform that action at this time.
0 commit comments