1
0
mirror of https://github.com/142vip/408CSFamily.git synced 2026-02-03 02:23:38 +08:00

feat: 修改本地镜像

This commit is contained in:
喜欢芝士的妹妹
2023-02-01 22:06:12 +08:00
parent c5a019b70c
commit 497fd0d9cf
3 changed files with 16 additions and 14 deletions

View File

@@ -4,10 +4,11 @@ LABEL version="Beta1.0" description="408CSFamily合集"
LABEL author="【Github&公众号】Rong姐姐好可爱" email="fairy@2925.com"
RUN mkdir -p /apps
## 确定工作空间 /apps
COPY . /apps
WORKDIR /apps
COPY . /apps
## 安装依赖
RUN npm ci --registry https://registry.npmmirror.com && npm run build
RUN npm i pnpm@6 -g && pnpm i -D && npm run build
@@ -16,5 +17,7 @@ FROM registry.cn-hangzhou.aliyuncs.com/142vip/nginx:1.23.0-alpine
COPY --from=build_base /apps/docs/.vuepress/dist/ /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/
EXPOSE 7000
CMD ["nginx", "-g", "daemon off;"]
#CMD ["nginx", "-g", "daemon off;"]

View File

@@ -2,6 +2,7 @@
user root;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
events {
worker_connections 1024;
}
@@ -15,7 +16,7 @@ http {
listen 7000;
server_name localhost;
# access_log /var/log/nginx/access.log main;
#access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log error;
## 静态资源代理
location / {

View File

@@ -1,7 +1,7 @@
#!/bin/bash
## 功能本地前后端项目构建、打包镜像上传docker仓库
## 参考https://blog.csdn.net/Dontla/article/details/125210694
## 作者:Rong姐姐好可爱
## 作者:储凡
## 使用示例bash xxx.sh 版本号
## - bash build_image.sh 0.0.1
##
@@ -29,9 +29,9 @@ prepare_check(){
}
run(){
echo -e "${successLogger}---------------- shell doc_book start ---------------- "
docker build -t "${repoAddress}${projectName}_${version}" .
echo -e "${successLogger}---------------- shell doc_book end ---------------- "
echo -e "${successLogger}---------------- shell ${projectName} start ---------------- "
docker build -t "${repoAddress}${projectName}-${version}" .
echo -e "${successLogger}---------------- shell ${projectName} end ---------------- "
push_docker_image
}
@@ -40,20 +40,18 @@ run(){
## 推送镜像
push_docker_image(){
if [[ "$(docker images -q "${repoAddress}${projectName}_${version}" 2> /dev/null)" != "" ]];
if [[ "$(docker images -q "${repoAddress}${projectName}-${version}" 2> /dev/null)" != "" ]];
then
## 推送
docker push "${repoAddress}${projectName}_${version}"
docker push "${repoAddress}${projectName}-${version}"
echo -e "${successLogger}---------------- 上传镜像成功,删除本地镜像 ---------------- "
docker rmi "${repoAddress}${projectName}_${version}"
docker rmi "${repoAddress}${projectName}-${version}"
else
echo -e "${errorLogger}${currentTime}:镜像:${repoAddress}${projectName}_${version}不存在"
echo -e "${errorLogger}${currentTime}:镜像:${repoAddress}${projectName}-${version}不存在"
fi
exit 0
}
prepare_check
run