update docker build script
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
@echo off
|
||||
|
||||
echo begin copy sql
|
||||
copy ..\sql\wfc-cloud.sql .\mysql\db
|
||||
copy ..\sql\wfc-config.sql .\mysql\db
|
||||
copy ..\sql\wfc_config_db\wfc_config_db.sql .\mysql\db
|
||||
copy ..\sql\wfc_system_db\wfc_system_db.sql .\mysql\db
|
||||
copy ..\sql\wfc_user_db\wfc_user_db.sql .\mysql\db
|
||||
|
||||
REM 复制 HTML 文件
|
||||
echo begin copy sys html
|
||||
|
||||
@@ -12,7 +12,7 @@ goto usage
|
||||
|
||||
REM 使用说明,用来提示输入参数
|
||||
:usage
|
||||
echo Usage: deploy.bat [port^|base^|modules^|stop^|rm]
|
||||
echo Usage: deploy.bat [port^|base^|modules^|backend^|stop^|rm]
|
||||
exit /b 1
|
||||
|
||||
REM 开启所需端口
|
||||
@@ -41,12 +41,12 @@ exit /b 0
|
||||
|
||||
REM 启动程序模块(必须)
|
||||
:modules
|
||||
docker-compose up -d wfc-nginx wfc-gateway wfc-auth wfc-modules-system wfc-modules-user wfc-modules-payment
|
||||
docker-compose up -d wfc-nginx wfc-gateway wfc-auth wfc-modules-file wfc-modules-job wfc-modules-gen wfc-modules-system wfc-modules-user wfc-modules-payment
|
||||
exit /b 0
|
||||
|
||||
REM 启动程序模块(后端)
|
||||
:backend
|
||||
docker-compose up -d wfc-gateway wfc-auth wfc-modules-system wfc-modules-user wfc-modules-payment
|
||||
docker-compose up -d wfc-gateway wfc-auth wfc-modules-file wfc-modules-job wfc-modules-gen wfc-modules-system wfc-modules-user wfc-modules-payment
|
||||
exit /b 0
|
||||
|
||||
REM 启动程序模块(前端)
|
||||
|
||||
@@ -35,7 +35,7 @@ services:
|
||||
'--lower-case-table-names=1'
|
||||
]
|
||||
environment:
|
||||
MYSQL_DATABASE: 'wfc-cloud'
|
||||
MYSQL_DATABASE: 'wfc_system_db'
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
wfc-redis:
|
||||
container_name: wfc-redis
|
||||
|
||||
@@ -25,7 +25,7 @@ http {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://192.168.2.248:8080/;
|
||||
proxy_pass http://wfc-gateway:8080/;
|
||||
}
|
||||
|
||||
location /u {
|
||||
@@ -39,7 +39,7 @@ http {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://192.168.2.248:8080/;
|
||||
proxy_pass http://wfc-gateway:8080/;
|
||||
}
|
||||
|
||||
# 避免actuator暴露
|
||||
|
||||
45
docker/start-backend.bat
Normal file
45
docker/start-backend.bat
Normal file
@@ -0,0 +1,45 @@
|
||||
@echo off
|
||||
|
||||
set profile_name=test
|
||||
if not "%1"=="" (
|
||||
set profile_name=%1
|
||||
)
|
||||
cd ..
|
||||
git pull
|
||||
call mvn clean package -P %profile_name%
|
||||
cd docker
|
||||
call copy.bat
|
||||
|
||||
docker stop wfc-gateway
|
||||
docker rm wfc-gateway
|
||||
docker rmi docker-wfc-gateway
|
||||
|
||||
docker stop wfc-auth
|
||||
docker rm wfc-auth
|
||||
docker rmi docker-wfc-auth
|
||||
|
||||
docker stop wfc-modules-file
|
||||
docker rm wfc-modules-file
|
||||
docker rmi docker-wfc-modules-file
|
||||
|
||||
docker stop wfc-modules-gen
|
||||
docker rm wfc-modules-gen
|
||||
docker rmi docker-wfc-modules-gen
|
||||
|
||||
docker stop wfc-modules-job
|
||||
docker rm wfc-modules-job
|
||||
docker rmi docker-wfc-modules-job
|
||||
|
||||
docker stop wfc-modules-system
|
||||
docker rm wfc-modules-system
|
||||
docker rmi docker-wfc-modules-system
|
||||
|
||||
docker stop wfc-modules-user
|
||||
docker rm wfc-modules-user
|
||||
docker rmi docker-wfc-modules-user
|
||||
|
||||
docker stop wfc-modules-payment
|
||||
docker rm wfc-modules-payment
|
||||
docker rmi docker-wfc-modules-payment
|
||||
|
||||
call deploy.bat backend
|
||||
@@ -1,8 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
profile_name=test
|
||||
if [ "$1" != "" ]; then
|
||||
profile_name=$1
|
||||
fi
|
||||
|
||||
cd ..
|
||||
git pull
|
||||
mvn clean package -P test
|
||||
mvn clean package -P ${profile_name}
|
||||
cd docker
|
||||
./copy.sh
|
||||
|
||||
|
||||
22
docker/start-frontend.bat
Normal file
22
docker/start-frontend.bat
Normal file
@@ -0,0 +1,22 @@
|
||||
@echo off
|
||||
|
||||
REM Change to the fe.wfc directory and update the repository
|
||||
cd /d ..\..\fe.wfc
|
||||
git pull
|
||||
call pnpm install
|
||||
call pnpm build
|
||||
|
||||
REM Change to the fe.wfc.user directory and update the repository
|
||||
cd /d ..\fe.wfc.user
|
||||
git pull
|
||||
call pnpm install
|
||||
call pnpm build
|
||||
|
||||
REM Change to the be.wfc/docker directory and run the copy script
|
||||
cd /d ..\be.wfc\docker
|
||||
call copy.bat
|
||||
|
||||
REM Stop, remove, and deploy the Docker container for wfc-nginx
|
||||
docker stop wfc-nginx
|
||||
docker rm wfc-nginx
|
||||
call deploy.bat frontend
|
||||
@@ -1,19 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
cd /home/simon/wfc.git/fe.wfc
|
||||
cd ../../fe.wfc
|
||||
git pull
|
||||
pnpm i
|
||||
pnpm build
|
||||
|
||||
#
|
||||
cd /home/simon/wfc.git/fe.wfc.user
|
||||
cd ../fe.wfc.user
|
||||
git pull
|
||||
pnpm i
|
||||
pnpm build
|
||||
|
||||
#
|
||||
cd /home/simon/wfc.git/be.wfc/docker
|
||||
cd ../be.wfc/docker
|
||||
./copy.sh
|
||||
|
||||
sudo docker stop wfc-nginx
|
||||
|
||||
Reference in New Issue
Block a user