2
0

feat: init build release

This commit is contained in:
simonzhangsz
2024-12-12 18:10:43 +08:00
parent 4f075ae506
commit 60a8af09be
43 changed files with 1048 additions and 1 deletions

59
build/bin/wfccontrol.sh Normal file
View File

@@ -0,0 +1,59 @@
#!/bin/bash
WFCWorkDir=/opt/wfc
DockerDir=${WFCWorkDir}/docker
DockerCompose=/usr/bin/docker-compose
usage() {
echo "Usage: sh wfccontrol.sh [start|stop|status|version]"
exit 1
}
start(){
cd ${DockerDir}
${DockerCompose} up -d
}
stop(){
cd ${DockerDir}
${DockerCompose} down
}
Jars=" \
/opt/wfc/docker/wfc/auth/jar/wfc-auth.jar \
/opt/wfc/docker/wfc/gateway/jar/wfc-gateway.jar \
/opt/wfc/docker/wfc/modules/system/jar/wfc-modules-system.jar \
/opt/wfc/docker/wfc/modules/user/jar/wfc-modules-user.jar \
/opt/wfc/docker/wfc/modules/gen/jar/wfc-modules-gen.jar \
/opt/wfc/docker/wfc/modules/file/jar/wfc-modules-file.jar \
/opt/wfc/docker/wfc/modules/job/jar/wfc-modules-job.jar \
/opt/wfc/docker/wfc/modules/payment/jar/wfc-modules-payment.jar \
"
status(){
cd ${DockerDir}
${DockerCompose} ps
}
# print wfc version
version(){
java printJarVer ${Jars}
}
case "$1" in
"start")
start
;;
"stop")
stop
;;
"status")
status
;;
"version")
version
;;
*)
usage
;;
esac

22
build/bin/wfcsetup.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
WFCWorkDir=/opt/wfc
DockerWorkDir=${WFCWorkDir}/docker
SrcServiceDir=${WFCWorkDir}/systemd/system
DstServiceDir=/etc/systemd/system
# prepare directory
ln -sf /tmp ${DockerWorkDir}/mysql/
chown -R root:root ${DockerWorkDir}/*
chown -R mysql:mysql ${DockerWorkDir}/mysql
chmod -R 755 ${DockerWorkDir}/mysql/*
# setup system serivce
cp -rf ${SrcServiceDir}/wfccontrol.service ${DstServiceDir}/
systemctl daemon-reload
systemctl enable wfccontrol.service
# build docker compose
cd ${DockerWorkDir}
docker-compose build

View File

@@ -0,0 +1,178 @@
services:
wfc-nacos:
container_name: wfc-nacos
image: nacos/nacos-server
build:
context: ./nacos
environment:
- MODE=standalone
- NACOS_SERVER_ADDR=192.168.13.128
volumes:
- ./nacos/logs/:/home/nacos/logs
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
depends_on:
- wfc-mysql
restart: always
wfc-mysql:
container_name: wfc-mysql
image: mysql:5.7
build:
context: ./mysql
ports:
- "3306:3306"
volumes:
- ./mysql/conf:/etc/mysql/conf.d
- ./mysql/logs:/logs
- ./mysql/data:/var/lib/mysql
- ./mysql/tmp:/tmp
command: [
'mysqld',
'--innodb-buffer-pool-size=80M',
'--character-set-server=utf8mb4',
'--collation-server=utf8mb4_unicode_ci',
'--default-time-zone=+8:00',
'--lower-case-table-names=1'
]
environment:
MYSQL_DATABASE: 'wfc_system_db'
MYSQL_ROOT_PASSWORD: 123456
restart: always
wfc-redis:
container_name: wfc-redis
image: redis
build:
context: ./redis
ports:
- "6379:6379"
volumes:
- ./redis/conf/redis.conf:/home/wfc/redis/redis.conf
- ./redis/data:/data
command: redis-server /home/wfc/redis/redis.conf
restart: always
wfc-gateway:
container_name: wfc-gateway
build:
context: ./wfc/gateway
dockerfile: dockerfile
ports:
- "8080:8080"
depends_on:
- wfc-redis
links:
- wfc-redis
restart: always
wfc-auth:
container_name: wfc-auth
build:
context: ./wfc/auth
dockerfile: dockerfile
ports:
- "9200:9200"
depends_on:
- wfc-redis
links:
- wfc-redis
restart: always
wfc-modules-system:
container_name: wfc-modules-system
build:
context: ./wfc/modules/system
dockerfile: dockerfile
ports:
- "9201:9201"
depends_on:
- wfc-redis
- wfc-mysql
links:
- wfc-redis
- wfc-mysql
restart: always
wfc-modules-user:
container_name: wfc-modules-user
build:
context: ./wfc/modules/user
dockerfile: dockerfile
ports:
- "9204:9204"
depends_on:
- wfc-redis
- wfc-mysql
links:
- wfc-redis
- wfc-mysql
restart: always
wfc-modules-gen:
container_name: wfc-modules-gen
build:
context: ./wfc/modules/gen
dockerfile: dockerfile
ports:
- "9202:9202"
depends_on:
- wfc-mysql
links:
- wfc-mysql
restart: always
wfc-modules-job:
container_name: wfc-modules-job
build:
context: ./wfc/modules/job
dockerfile: dockerfile
ports:
- "9203:9203"
depends_on:
- wfc-mysql
links:
- wfc-mysql
restart: always
wfc-modules-file:
container_name: wfc-modules-file
build:
context: ./wfc/modules/file
dockerfile: dockerfile
ports:
- "9300:9300"
volumes:
- ./wfc/upload:/home/wfc/upload
restart: always
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
restart: always
wfc-visual-monitor:
container_name: wfc-visual-monitor
build:
context: ./wfc/visual/monitor
dockerfile: dockerfile
ports:
- "9100:9100"
restart: always
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
restart: always

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>sqlĿ¼<EFBFBD>µ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>нű<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD>Զ<EFBFBD>ִ<EFBFBD>С<EFBFBD>

View File

@@ -0,0 +1,7 @@
# 基础镜像
FROM mysql:5.7
# author
MAINTAINER wfc
# 执行sql脚本
ADD ./db/*.sql /docker-entrypoint-initdb.d/

View File

@@ -0,0 +1,33 @@
spring.datasource.platform=mysql
db.num=1
db.url.0=jdbc:mysql://wfc-mysql:3306/wfc_config_db?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user=root
db.password=123456
nacos.naming.empty-service.auto-clean=true
nacos.naming.empty-service.clean.initial-delay-ms=50000
nacos.naming.empty-service.clean.period-time-ms=30000
nacos.server.ip=${NACOS_SERVER_ADDR}
management.endpoints.web.exposure.include=*
management.metrics.export.elastic.enabled=false
management.metrics.export.influx.enabled=false
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
server.tomcat.basedir=/home/wfc/nacos/tomcat/logs
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
nacos.core.auth.system.type=nacos
nacos.core.auth.enabled=false
nacos.core.auth.default.token.expire.seconds=18000
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
nacos.core.auth.caching.enabled=true
nacos.core.auth.enable.userAgentAuthWhite=false
nacos.core.auth.server.identity.key=serverIdentity
nacos.core.auth.server.identity.value=security
nacos.istio.mcp.server.enabled=false

View File

@@ -0,0 +1,7 @@
# 基础镜像
FROM nacos/nacos-server
# author
MAINTAINER wfc
# 复制conf文件到路径
COPY ./conf/application.properties /home/nacos/conf/application.properties

View File

@@ -0,0 +1,55 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location /sys {
root /home/wfc/portal;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /sys-api/{
proxy_set_header Host $http_host;
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://wfc-gateway:8080/;
}
location /u {
root /home/wfc/portal;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /u-api/{
proxy_set_header Host $http_host;
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://wfc-gateway:8080/;
}
# 避免actuator暴露
if ($request_uri ~ "/actuator") {
return 403;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

View File

@@ -0,0 +1,10 @@
# 基础镜像
FROM nginx
# author
MAINTAINER wfc
# 工作目录
WORKDIR /home/wfc/portal
# 复制conf文件到路径
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
# 复制html文件到路径
COPY ./html /home/wfc/portal

View File

@@ -0,0 +1,3 @@
1. 目录./sys存放客户平台(sys portal)前端文件
2. 目录./u存放用户平台(user portal)前端文件
用于nginx自动执行

View File

@@ -0,0 +1 @@
# requirepass 123456

View File

@@ -0,0 +1,13 @@
# 基础镜像
FROM redis
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc/redis
# 创建目录
RUN mkdir -p /home/wfc/redis
# 指定路径
WORKDIR /home/wfc/redis
# 复制conf文件到路径
COPY ./conf/redis.conf /home/wfc/redis/redis.conf

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-auth.jar /home/wfc/wfc-auth.jar
# 启动认证服务
ENTRYPOINT ["java","-jar","wfc-auth.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-gateway.jar /home/wfc/wfc-gateway.jar
# 启动网关服务
ENTRYPOINT ["java","-jar","wfc-gateway.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-modules-file.jar /home/wfc/wfc-modules-file.jar
# 启动文件服务
ENTRYPOINT ["java","-jar","wfc-modules-file.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-modules-gen.jar /home/wfc/wfc-modules-gen.jar
# 启动代码生成服务
ENTRYPOINT ["java","-jar","wfc-modules-gen.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD>Ŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-modules-job.jar /home/wfc/wfc-modules-job.jar
# 启动定时任务服务
ENTRYPOINT ["java","-jar","wfc-modules-job.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD>Ŷ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -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"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-modules-system.jar /home/wfc/wfc-modules-system.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","wfc-modules-system.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-modules-user.jar /home/wfc/wfc-modules-user.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","wfc-modules-user.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,15 @@
# 基础镜像
FROM openjdk:8-jre
# author
MAINTAINER wfc
# 挂载目录
VOLUME /home/wfc
# 创建目录
RUN mkdir -p /home/wfc
# 指定路径
WORKDIR /home/wfc
# 复制jar文件到路径
COPY ./jar/wfc-visual-monitor.jar /home/wfc/wfc-visual-monitor.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","wfc-visual-monitor.jar"]

View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD>ż<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>jar<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>docker<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>á<EFBFBD>

View File

@@ -0,0 +1,14 @@
[Unit]
Description=WANFi Controller Service
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/opt/wfc/docker
ExecStart=/opt/wfc/bin/wfccontrol.sh start
ExecStop=/opt/wfc/bin/wfccontrol.sh stop
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target