增加配置文件修改
This commit is contained in:
parent
8831100cc4
commit
023ea78d18
|
|
@ -1,35 +0,0 @@
|
||||||
# 后端 Dockerfile
|
|
||||||
FROM maven:3.8.5-openjdk-8 AS build
|
|
||||||
|
|
||||||
# 设置工作目录
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# 复制 pom.xml 和源代码
|
|
||||||
COPY pom.xml .
|
|
||||||
COPY ruoyi-admin ./ruoyi-admin
|
|
||||||
COPY ruoyi-common ./ruoyi-common
|
|
||||||
COPY ruoyi-framework ./ruoyi-framework
|
|
||||||
COPY ruoyi-generator ./ruoyi-generator
|
|
||||||
COPY ruoyi-quartz ./ruoyi-quartz
|
|
||||||
COPY ruoyi-system ./ruoyi-system
|
|
||||||
COPY excel-handle ./excel-handle
|
|
||||||
|
|
||||||
# 构建项目
|
|
||||||
RUN mvn clean package -DskipTests
|
|
||||||
|
|
||||||
# 运行阶段
|
|
||||||
FROM openjdk:8-jre-slim
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# 复制构建好的 jar 包
|
|
||||||
COPY --from=build /app/ruoyi-admin/target/*.jar app.jar
|
|
||||||
|
|
||||||
# 创建上传目录
|
|
||||||
RUN mkdir -p /home/ruoyi/uploadPath
|
|
||||||
|
|
||||||
# 暴露端口
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
# 启动应用
|
|
||||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
# MySQL 数据库
|
||||||
|
mysql:
|
||||||
|
image: mysql:8.0
|
||||||
|
container_name: wecom-mysql
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: ash@szmp
|
||||||
|
MYSQL_DATABASE: ash-vue
|
||||||
|
MYSQL_USER: ash
|
||||||
|
MYSQL_PASSWORD: ash@szmp
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
volumes:
|
||||||
|
- mysql_data:/var/lib/mysql
|
||||||
|
- mysql_conf:/etc/mysql/conf.d
|
||||||
|
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||||
|
networks:
|
||||||
|
- wecom-network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-pash@szmp"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
# Redis 缓存
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
container_name: wecom-redis
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
command: redis-server --appendonly yes --requirepass ash@szmp
|
||||||
|
networks:
|
||||||
|
- wecom-network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
# 后端服务
|
||||||
|
backend:
|
||||||
|
build:
|
||||||
|
context: ./backend
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: wecom-backend
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8888:8888"
|
||||||
|
volumes:
|
||||||
|
- upload_data:/home/ash/uploadPath
|
||||||
|
environment:
|
||||||
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/ash-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
SPRING_DATASOURCE_USERNAME: ash
|
||||||
|
SPRING_DATASOURCE_PASSWORD: ash@szmp
|
||||||
|
SPRING_REDIS_HOST: redis
|
||||||
|
SPRING_REDIS_PORT: 6379
|
||||||
|
SPRING_REDIS_PASSWORD: ash@szmp
|
||||||
|
depends_on:
|
||||||
|
mysql:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
|
networks:
|
||||||
|
- wecom-network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8888/"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
|
# 前端服务
|
||||||
|
frontend:
|
||||||
|
build:
|
||||||
|
context: ./frontend
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: wecom-frontend
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8889:80"
|
||||||
|
depends_on:
|
||||||
|
backend:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- wecom-network
|
||||||
|
|
||||||
|
# 数据卷
|
||||||
|
volumes:
|
||||||
|
mysql_data:
|
||||||
|
driver: local
|
||||||
|
mysql_conf:
|
||||||
|
driver: local
|
||||||
|
redis_data:
|
||||||
|
driver: local
|
||||||
|
upload_data:
|
||||||
|
driver: local
|
||||||
|
|
||||||
|
# 网络
|
||||||
|
networks:
|
||||||
|
wecom-network:
|
||||||
|
driver: bridge
|
||||||
|
|
@ -6,9 +6,9 @@ spring:
|
||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://host.docker.internal:3316/excel-handle?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://mysql:3306/ash-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: ash
|
||||||
password: jiong1114
|
password: ash@szmp
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
# 项目相关配置
|
# 项目相关配置
|
||||||
ruoyi:
|
ruoyi:
|
||||||
# 名称
|
# 名称
|
||||||
name: RuoYi
|
name: Ash
|
||||||
# 版本
|
# 版本
|
||||||
version: 3.9.1
|
version: 3.9.1
|
||||||
# 版权年份
|
# 版权年份
|
||||||
copyrightYear: 2026
|
copyrightYear: 2026
|
||||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||||
profile: /home/ruoyi/uploadPath
|
profile: /home/ash/uploadPath
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
# 验证码类型 math 数字计算 char 字符验证
|
# 验证码类型 math 数字计算 char 字符验证
|
||||||
|
|
@ -69,13 +69,13 @@ spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: localhost
|
host: redis
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 0
|
database: 0
|
||||||
# 密码
|
# 密码
|
||||||
password:
|
password: ash@szmp
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
lettuce:
|
lettuce:
|
||||||
|
|
@ -136,7 +136,7 @@ referer:
|
||||||
# 防盗链开关
|
# 防盗链开关
|
||||||
enabled: false
|
enabled: false
|
||||||
# 允许的域名列表
|
# 允许的域名列表
|
||||||
allowed-domains: localhost,127.0.0.1,ruoyi.vip,www.ruoyi.vip
|
allowed-domains: localhost,127.0.0.1
|
||||||
|
|
||||||
# 防止XSS攻击
|
# 防止XSS攻击
|
||||||
xss:
|
xss:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue