Skip to content

Commit 8cc0878

Browse files
committed
update shell
1 parent b614543 commit 8cc0878

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

Dockerfile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
# 安装node
1+
# 安装node 作为基础构建镜像
22
# FROM node:12.6.0-alpine AS build_base
33
FROM node AS build_base
44

5-
# 标签
5+
# 镜像标签
66
LABEL version="Beta1.0"
77
LABEL description="JavaScriptCollection文档合集、博客"
8-
# 作者
8+
# 作者信息
99
LABEL author="【Github&公众号】:Rong姐姐好可爱"
1010
LABEL email="mmdapl@163.com"
1111

12+
## 确定工作空间 /apps
1213
COPY . /apps
1314
WORKDIR /apps
14-
## 配置cnpm
15-
# RUN npm install -g cnpm --registry=https://registry.npmmirror.com && c
16-
# RUN npm install -D && npm run build
17-
# RUN npm install pnpm -g
18-
RUN npm install
19-
RUN npm run build
2015

21-
RUN find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
16+
## 安装依赖
17+
RUN npm install && npm run build
2218

2319
# 设置部署镜像
2420
FROM nginx
21+
2522
# 将dist文件中的内容复制到 /usr/share/nginx/html/ 这个目录下面 注意:--from参数
2623
COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
2724

2825

2926
## 暴露端口
30-
EXPOSE 80
27+
EXPOSE 80

0 commit comments

Comments
 (0)