Skip to content

Commit 38f214a

Browse files
author
喜欢葡萄+芝士的妹妹
committed
feat: 更新版本号配置
1 parent 84fbe48 commit 38f214a

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ LABEL version="Beta1.0" description="JavaScriptCollection文档合集、博客"
44
LABEL author="【Github&公众号】:Rong姐姐好可爱" email="fairy@2925.com"
55
RUN mkdir -p /apps
66
## 确定工作空间 /apps
7-
COPY . /apps
87
WORKDIR /apps
8+
COPY . /apps
99

1010
## 安装依赖
11-
RUN npm ci --registry https://registry.npmmirror.com && npm run build
11+
RUN npm i pnpm@6 -g && pnpm i -D && npm run build
1212

1313
# 设置部署镜像
1414
FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:latest
@@ -18,4 +18,4 @@ COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
1818
## 配置文件
1919
COPY nginx.conf /etc/nginx/
2020
EXPOSE 7100
21-
CMD ["nginx", "-g", "daemon off;"]
21+
#CMD ["nginx", "-g", "daemon off;"]

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import sidebar from "./config/sidebar";
1010
export default {
1111
title: "凡是过往、皆为序章",
1212
description: "一本有趣的JavaScript合集",
13-
// base: "/JavaScriptCollection/",
13+
base: "/JavaScriptCollection/",
1414
port: 7100,
1515
head: [
1616
["link", {rel: "icon", href: "/fight_favicon.ico"}]

scripts/build_image.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22
## 功能:本地前后端项目构建、打包镜像,上传docker仓库
33
## 参考:https://blog.csdn.net/Dontla/article/details/125210694
4-
## 作者:Rong姐姐好可爱
5-
## 使用示例:bash xxx.sh 容器名称 版本号
4+
## 作者:储凡
5+
## 使用示例:bash xxx.sh 版本号
66
## - bash build_image.sh 0.0. x
77
##
88

@@ -28,9 +28,9 @@ prepare_check(){
2828
}
2929

3030
run(){
31-
echo -e "${successLogger}---------------- shell doc_book start ---------------- "
32-
docker build -t "${repoAddress}:${projectName}_${version}" .
33-
echo -e "${successLogger}---------------- shell doc_book end ---------------- "
31+
echo -e "${successLogger}---------------- shell ${projectName} start ---------------- "
32+
docker build -t "${repoAddress}:${projectName}-${version}" .
33+
echo -e "${successLogger}---------------- shell ${projectName} end ---------------- "
3434
push_docker_image
3535
}
3636

@@ -39,14 +39,14 @@ run(){
3939

4040
## 推送镜像
4141
push_docker_image(){
42-
if [[ "$(docker images -q "${repoAddress}:${projectName}_${version}" 2> /dev/null)" != "" ]];
42+
if [[ "$(docker images -q "${repoAddress}:${projectName}-${version}" 2> /dev/null)" != "" ]];
4343
then
4444
## 推送
45-
docker push "${repoAddress}:${projectName}_${version}"
45+
docker push "${repoAddress}:${projectName}-${version}"
4646
echo -e "${successLogger}---------------- 上传镜像成功,删除本地镜像 ---------------- "
47-
docker rmi "${repoAddress}:${projectName}_${version}"
47+
docker rmi "${repoAddress}:${projectName}-${version}"
4848
else
49-
echo -e "${errorLogger}${currentTime}:镜像:${repoAddress}:${projectName}_${version}不存在"
49+
echo -e "${errorLogger}${currentTime}:镜像:${repoAddress}:${projectName}-${version}不存在"
5050
fi
5151
exit 0
5252
}

0 commit comments

Comments
 (0)