Files
GEAR-OA/gear-admin/src/main/resources/application-docker.yml
Joshi 5c445b3bae refactor(gear): 重构应用配置并优化代码
- 重构了 application-docker.yml 文件,使用环境变量替代硬编码的配置值
- 优化了 Redis、Mail、SMS 等配置,提高了灵活性和可维护性
-调整了数据源配置,支持动态数据源和更多配置选项
- 移除了 GearPurchasePlanDetailBo 类中未使用的 totalAmount 字段
- 优化了代码格式和注释,提高了代码可读性
2025-09-04 13:35:00 +08:00

109 lines
3.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# --- 临时文件存储位置
spring.servlet.multipart.location: ${APP_TEMP_DIR:/ruoyi/server/temp}
# --- 监控中心Spring Boot Admin Client
spring.boot:
admin:
client:
enabled: ${ADMIN_CLIENT_ENABLED:true}
url: ${ADMIN_SERVER_URL:http://admin:9090/admin}
instance:
service-host-type: IP
username: ${ADMIN_USERNAME:ruoyi}
password: ${ADMIN_PASSWORD:123456}
# --- xxl-job 配置
xxl:
job:
enabled: ${XXL_ENABLED:false}
admin-addresses: ${XXL_ADMIN_ADDR:http://xxl-job-admin:9100/xxl-job-admin}
access-token: ${XXL_ACCESS_TOKEN:xxl-job}
executor:
appname: ${XXL_APPNAME:xxl-job-executor}
port: ${XXL_PORT:9101}
address: ${XXL_ADDRESS:}
ip: ${XXL_IP:}
logpath: ${XXL_LOGPATH:./logs/xxl-job}
logretentiondays: ${XXL_LOG_RETENTION_DAYS:30}
# --- 数据源(动态数据源 + Hikari
spring.datasource:
type: com.zaxxer.hikari.HikariDataSource
dynamic:
p6spy: ${DS_P6SPY:false}
primary: ${DS_PRIMARY:master}
strict: ${DS_STRICT:true}
datasource:
master:
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${DB_HOST:mysql}:${DB_PORT:3306}/${DB_NAME:gear}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=${DB_USE_SSL:false}&serverTimezone=${DB_TZ:Asia/Shanghai}&autoReconnect=true&rewriteBatchedStatements=true
username: ${DB_USER:root}
password: ${DB_PASS:root}
slave:
lazy: ${DS_SLAVE_LAZY:true}
type: ${spring.datasource.type}
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://${DB_SLAVE_HOST:${DB_HOST:mysql}}:${DB_SLAVE_PORT:${DB_PORT:3306}}/${DB_SLAVE_NAME:${DB_NAME:gear}}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=${DB_USE_SSL:false}&serverTimezone=${DB_TZ:Asia/Shanghai}&autoReconnect=true&rewriteBatchedStatements=true
username: ${DB_SLAVE_USER:${DB_USER:root}}
password: ${DB_SLAVE_PASS:${DB_PASS:root}}
hikari:
maxPoolSize: ${HIKARI_MAX_POOL:20}
minIdle: ${HIKARI_MIN_IDLE:10}
connectionTimeout: ${HIKARI_CONN_TIMEOUT:30000}
validationTimeout: ${HIKARI_VALID_TIMEOUT:5000}
idleTimeout: ${HIKARI_IDLE_TIMEOUT:600000}
maxLifetime: ${HIKARI_MAX_LIFETIME:1800000}
connectionTestQuery: ${HIKARI_TEST_QUERY:SELECT 1}
keepaliveTime: ${HIKARI_KEEPALIVE:30000}
# --- Redis单机
spring:
redis:
host: ${REDIS_HOST:redis}
port: ${REDIS_PORT:6379}
database: ${REDIS_DB:0}
# password: ${REDIS_PASSWORD:} # 有密码再开启
timeout: ${REDIS_TIMEOUT:10s}
ssl: ${REDIS_SSL:false}
redisson:
keyPrefix: ${REDIS_KEY_PREFIX:}
threads: ${REDIS_THREADS:16}
nettyThreads: ${REDIS_NETTY_THREADS:32}
singleServerConfig:
clientName: ${APP_NAME:ruoyi}
connectionMinimumIdleSize: ${REDIS_MIN_IDLE:32}
connectionPoolSize: ${REDIS_POOL_SIZE:64}
idleConnectionTimeout: ${REDIS_IDLE_TIMEOUT:10000}
timeout: ${REDIS_CMD_TIMEOUT:3000}
subscriptionConnectionPoolSize: ${REDIS_SUB_POOL:50}
# --- Mail
mail:
enabled: ${MAIL_ENABLED:false}
host: ${MAIL_HOST:smtp.163.com}
port: ${MAIL_PORT:465}
auth: ${MAIL_AUTH:true}
from: ${MAIL_FROM:xxx@163.com}
user: ${MAIL_USER:xxx@163.com}
pass: ${MAIL_PASS:xxxxxxxxxx}
starttlsEnable: ${MAIL_STARTTLS:true}
sslEnable: ${MAIL_SSL:true}
timeout: ${MAIL_TIMEOUT:0}
connectionTimeout: ${MAIL_CONN_TIMEOUT:0}
# --- SMS
sms:
enabled: ${SMS_ENABLED:false}
endpoint: ${SMS_ENDPOINT:dysmsapi.aliyuncs.com}
accessKeyId: ${SMS_AK:xxxxxxx}
accessKeySecret: ${SMS_SK:xxxxxx}
signName: ${SMS_SIGN:测试}
# --- 其他常用可调
server:
port: ${SERVER_PORT:8080}
tomcat:
max-threads: ${TOMCAT_MAX_THREADS:200}