2
0

fix: 调整docke脚本

This commit is contained in:
TsMask
2024-12-03 17:51:18 +08:00
parent 8da56d1d09
commit 64aec35014
7 changed files with 58 additions and 35 deletions

View File

@@ -9,19 +9,20 @@ usage() {
# copy sql
echo "begin copy sql "
cp ../sql/wfc-cloud.sql ./mysql/db
cp ../sql/wfc-config.sql ./mysql/db
cp ../sql/wfc_config_db/wfc_config_db.sql ./mysql/db
cp ../sql/wfc_system_db/wfc_system_db.sql ./mysql/db
cp ../sql/wfc_user_db/wfc_user_db.sql ./mysql/db
# copy html
echo "begin copy system html "
mkdir -p ./nginx/html/dist/sys/
rm -rf ./nginx/html/dist/sys/*
cp -rf ../../fe.wfc/dist/** ./nginx/html/dist/sys/
mkdir -p ./nginx/html/sys
rm -rf ./nginx/html/sys
cp -rf ../../fe.wfc/dist ./nginx/html/sys
echo "begin copy user html "
mkdir -p ./nginx/html/dist/u/
rm -rf ./nginx/html/dist/u/
cp -rf ../../fe.wfc.user/dist/** ./nginx/html/dist/u/
mkdir -p ./nginx/html/u
rm -rf ./nginx/html/u
cp -rf ../../fe.wfc.user/dist./nginx/html/u
# copy jar
echo "begin copy wfc-gateway "

View File

@@ -48,22 +48,7 @@ services:
- ./redis/conf/redis.conf:/home/wfc/redis/redis.conf
- ./redis/data:/data
command: redis-server /home/wfc/redis/redis.conf
wfc-nginx:
container_name: wfc-nginx
image: nginx
build:
context: ./nginx
ports:
- "80:80"
volumes:
- ./nginx/html/dist:/home/wfc/portal
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/logs:/var/log/nginx
- ./nginx/conf.d:/etc/nginx/conf.d
depends_on:
- wfc-gateway
links:
- wfc-gateway
wfc-gateway:
container_name: wfc-gateway
build:
@@ -161,3 +146,20 @@ services:
dockerfile: dockerfile
ports:
- "9100:9100"
wfc-nginx:
container_name: wfc-nginx
image: nginx
build:
context: ./nginx
ports:
- "80:80"
volumes:
- ./nginx/html:/home/wfc/portal
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/logs:/var/log/nginx
- ./nginx/conf.d:/etc/nginx/conf.d
depends_on:
- wfc-gateway
links:
- wfc-gateway

View File

@@ -2,14 +2,9 @@
FROM nginx
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc/portal
# 创建目录
RUN mkdir -p /home/wfc/portal
# 指定路径
# 工作目录
WORKDIR /home/wfc/portal
# 复制conf文件到路径
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
# 复制html文件到路径
COPY ./html/dist /home/wfc/portal
COPY ./html /home/wfc/portal

View File

@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>客户平台</title>
</head>
<body>
<h1>客户平台</h1>
</body>
</html>

View File

@@ -5,17 +5,21 @@ git pull
mvn clean package -P test
cd docker
./copy.sh
sudo docker stop wfc-gateway
sudo docker rm wfc-gateway
sudo docker rmi docker_wfc-gateway
sudo docker stop wfc-auth
sudo docker rm wfc-auth
sudo docker rmi docker_wfc-auth
sudo docker stop wfc-modules-system
sudo docker rm wfc-modules-system
sudo docker rmi docker_wfc-modules-system
sudo docker stop wfc-modules-user
sudo docker rm wfc-modules-user
sudo docker rmi docker_wfc-modules-user
sudo ./deploy.sh backend
sudo docker restart wfc-modules-system

View File

@@ -1,12 +1,22 @@
#!/bin/sh
cd ../../fe.wfc/
#
cd /home/simon/wfc.git/fe.wfc
git pull
pnpm i
pnpm build
cd ../be.wfc/docker/
#
cd /home/simon/wfc.git/fe.wfc.user
git pull
pnpm i
pnpm build
#
cd /home/simon/wfc.git/be.wfc/docker
./copy.sh
sudo docker stop wfc-nginx
sudo docker rm wfc-nginx
sudo docker rmi nginx
sudo docker rmi wfc-nginx
sudo ./deploy.sh frontend