From ac8d3c5beeb27df8966ded7c34f4adc3777efac9 Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Thu, 28 Nov 2024 16:24:48 +0800 Subject: [PATCH] add: docker env contain payment module --- docker/copy.bat | 39 +++++++++++++ docker/copy.sh | 2 + docker/deploy.bat | 67 +++++++++++++++++++++++ docker/deploy.sh | 6 +- docker/docker-compose.yml | 11 ++++ docker/wfc/modules/payment/dockerfile | 15 +++++ docker/wfc/modules/payment/jar/readme.txt | 1 + 7 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 docker/copy.bat create mode 100644 docker/deploy.bat create mode 100644 docker/wfc/modules/payment/dockerfile create mode 100644 docker/wfc/modules/payment/jar/readme.txt diff --git a/docker/copy.bat b/docker/copy.bat new file mode 100644 index 0000000..c59a357 --- /dev/null +++ b/docker/copy.bat @@ -0,0 +1,39 @@ +@echo off + +echo begin copy sql +copy ..\sql\wfc-cloud.sql .\mysql\db +copy ..\sql\wfc-config.sql .\mysql\db + +REM 复制 HTML 文件 +echo begin copy html +xcopy /E /I ..\..\fe.wfc\dist\* .\nginx\html\dist + +REM 复制 JAR 文件 +echo begin copy wfc-gateway +copy ..\wfc-gateway\target\wfc-gateway.jar .\wfc\gateway\jar + +echo begin copy wfc-auth +copy ..\wfc-auth\target\wfc-auth.jar .\wfc\auth\jar + +echo begin copy wfc-visual +copy ..\wfc-visual\wfc-monitor\target\wfc-visual-monitor.jar .\wfc\visual\monitor\jar + +echo begin copy wfc-modules-system +copy ..\wfc-modules\wfc-system\target\wfc-modules-system.jar .\wfc\modules\system\jar + +echo begin copy wfc-modules-user +copy ..\wfc-modules\wfc-modules-user\target\wfc-modules-user.jar .\wfc\modules\user\jar + +echo begin copy wfc-modules-file +copy ..\wfc-modules\wfc-file\target\wfc-modules-file.jar .\wfc\modules\file\jar + +echo begin copy wfc-modules-job +copy ..\wfc-modules\wfc-job\target\wfc-modules-job.jar .\wfc\modules\job\jar + +echo begin copy wfc-modules-gen +copy ..\wfc-modules\wfc-gen\target\wfc-modules-gen.jar .\wfc\modules\gen\jar + +echo begin copy wfc-modules-payment +copy ..\wfc-modules\wfc-payment\target\wfc-modules-payment.jar .\wfc\modules\payment\jar + +exit /b 0 \ No newline at end of file diff --git a/docker/copy.sh b/docker/copy.sh index 5bcfb7b..52248ed 100755 --- a/docker/copy.sh +++ b/docker/copy.sh @@ -42,3 +42,5 @@ cp ../wfc-modules/wfc-job/target/wfc-modules-job.jar ./wfc/modules/job/jar echo "begin copy wfc-modules-gen " cp ../wfc-modules/wfc-gen/target/wfc-modules-gen.jar ./wfc/modules/gen/jar +echo "begin copy wfc-modules-payment " +cp -rf ../wfc-modules/wfc-payment/target/wfc-modules-payment.jar ./wfc/modules/payment/jar diff --git a/docker/deploy.bat b/docker/deploy.bat new file mode 100644 index 0000000..b110a3a --- /dev/null +++ b/docker/deploy.bat @@ -0,0 +1,67 @@ +@echo off + +REM 根据输入参数,选择执行对应方法,不输入则执行使用说明 +if "%1"=="port" goto port +if "%1"=="base" goto base +if "%1"=="modules" goto modules +if "%1"=="backend" goto backend +if "%1"=="frontend" goto frontend +if "%1"=="stop" goto stop +if "%1"=="rm" goto rm +goto usage + +REM 使用说明,用来提示输入参数 +:usage +echo Usage: deploy.bat [port^|base^|modules^|stop^|rm] +exit /b 1 + +REM 开启所需端口 +:port +netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80 +netsh advfirewall firewall add rule name="Open Port 8080" dir=in action=allow protocol=TCP localport=8080 +netsh advfirewall firewall add rule name="Open Port 8848" dir=in action=allow protocol=TCP localport=8848 +netsh advfirewall firewall add rule name="Open Port 9848" dir=in action=allow protocol=TCP localport=9848 +netsh advfirewall firewall add rule name="Open Port 9849" dir=in action=allow protocol=TCP localport=9849 +netsh advfirewall firewall add rule name="Open Port 6379" dir=in action=allow protocol=TCP localport=6379 +netsh advfirewall firewall add rule name="Open Port 3306" dir=in action=allow protocol=TCP localport=3306 +netsh advfirewall firewall add rule name="Open Port 9100" dir=in action=allow protocol=TCP localport=9100 +netsh advfirewall firewall add rule name="Open Port 9200" dir=in action=allow protocol=TCP localport=9200 +netsh advfirewall firewall add rule name="Open Port 9201" dir=in action=allow protocol=TCP localport=9201 +netsh advfirewall firewall add rule name="Open Port 9202" dir=in action=allow protocol=TCP localport=9202 +netsh advfirewall firewall add rule name="Open Port 9203" dir=in action=allow protocol=TCP localport=9203 +netsh advfirewall firewall add rule name="Open Port 9300-9399" dir=in action=allow protocol=TCP localport=9300-9399 +net stop mpssvc +net start mpssvc +exit /b 0 + +REM 启动基础环境(必须) +:base +docker-compose up -d wfc-mysql wfc-redis wfc-nacos +exit /b 0 + +REM 启动程序模块(必须) +:modules +docker-compose up -d wfc-nginx wfc-gateway wfc-auth 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 +exit /b 0 + +REM 启动程序模块(前端) +:frontend +docker-compose up -d wfc-nginx +exit /b 0 + +REM 关闭所有环境/模块 +:stop +docker-compose stop +exit /b 0 + +REM 删除所有环境/模块 +:rm +docker-compose rm +exit /b 0 + + diff --git a/docker/deploy.sh b/docker/deploy.sh index 09f2e5a..0025fbb 100755 --- a/docker/deploy.sh +++ b/docker/deploy.sh @@ -20,7 +20,7 @@ port(){ firewall-cmd --add-port=9201/tcp --permanent firewall-cmd --add-port=9202/tcp --permanent firewall-cmd --add-port=9203/tcp --permanent - firewall-cmd --add-port=9300/tcp --permanent + firewall-cmd --add-port=9300-9399/tcp --permanent service firewalld restart } @@ -31,12 +31,12 @@ base(){ # 启动程序模块(必须) modules(){ - docker-compose up -d wfc-nginx wfc-gateway wfc-auth wfc-modules-system wfc-modules-user + docker-compose up -d wfc-nginx wfc-gateway wfc-auth wfc-modules-system wfc-modules-user wfc-modules-payment } # 启动程序模块(后端) backend(){ - docker-compose up -d wfc-gateway wfc-auth wfc-modules-system wfc-modules-user + docker-compose up -d wfc-gateway wfc-auth wfc-modules-system wfc-modules-user wfc-modules-payment } # 启动程序模块(前端) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1ca2787..396ec08 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -144,6 +144,17 @@ services: - "9300:9300" volumes: - ./wfc/uploadPath:/home/wfc/uploadPath + wfc-modules-payment: + container_name: wfc-modules-payment + build: + context: ./wfc/modules/payment + dockerfile: dockerfile + ports: + - "9306:9306" + depends_on: + - wfc-mysql + links: + - wfc-mysql wfc-visual-monitor: container_name: wfc-visual-monitor build: diff --git a/docker/wfc/modules/payment/dockerfile b/docker/wfc/modules/payment/dockerfile new file mode 100644 index 0000000..edb0a3e --- /dev/null +++ b/docker/wfc/modules/payment/dockerfile @@ -0,0 +1,15 @@ +# 基础镜像 +FROM openjdk:8-jre +# author +LABEL org.wfc.image.authors="wfc@wfc.org" + +# 挂载目录 +VOLUME /home/wfc +# 创建目录 +RUN mkdir -p /home/wfc +# 指定路径 +WORKDIR /home/wfc +# 复制jar文件到路径 +COPY ./jar/wfc-modules-payment.jar /home/wfc/wfc-modules-payment.jar +# 启动系统服务 +ENTRYPOINT ["java","-jar","wfc-modules-payment.jar"] \ No newline at end of file diff --git a/docker/wfc/modules/payment/jar/readme.txt b/docker/wfc/modules/payment/jar/readme.txt new file mode 100644 index 0000000..cfc2a92 --- /dev/null +++ b/docker/wfc/modules/payment/jar/readme.txt @@ -0,0 +1 @@ +ϵͳģõjarļdockerӦá \ No newline at end of file