parent
d02bda950f
commit
4909e6eda4
@ -0,0 +1,57 @@
|
|||||||
|
version: '3.3'
|
||||||
|
services:
|
||||||
|
# 构建 MySQL数据库 这里不指定数据库文件 防止误操作 等隐患问题
|
||||||
|
opsli-boot-mysql:
|
||||||
|
build: ./db-file
|
||||||
|
image: opsli-boot-mysql
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
# root 账户默认密码 生产时请更改
|
||||||
|
MYSQL_ROOT_PASSWORD: 123456
|
||||||
|
MYSQL_ROOT_HOST: '%'
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
container_name: opsli-boot-mysql
|
||||||
|
command:
|
||||||
|
--character-set-server=utf8mb4
|
||||||
|
--collation-server=utf8mb4_general_ci
|
||||||
|
--explicit_defaults_for_timestamp=true
|
||||||
|
--lower_case_table_names=1
|
||||||
|
--max_allowed_packet=128M
|
||||||
|
--default-authentication-plugin=caching_sha2_password
|
||||||
|
volumes:
|
||||||
|
- /var/mysql/data:/var/lib/mysql #挂载 MySQL数据
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
|
||||||
|
# 构建 Redis
|
||||||
|
opsli-boot-redis:
|
||||||
|
image: redis:6.2.3
|
||||||
|
restart: always
|
||||||
|
container_name: opsli-boot-redis
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
command: redis-server /usr/local/etc/redis/redis.conf --appendonly yes # 表示通过挂载配置文件追加配置
|
||||||
|
volumes:
|
||||||
|
- /var/redis/data:/data #挂载 Redis数据
|
||||||
|
- /var/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf #挂载 Redis配置
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
|
||||||
|
opsli-boot:
|
||||||
|
build: ./
|
||||||
|
restart: on-failure
|
||||||
|
container_name: opsli-boot
|
||||||
|
image: opsli-boot
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
LANG: en_US.UTF-8
|
||||||
|
command:
|
||||||
|
- -Xmx2048m
|
||||||
|
- -Xms2048m
|
||||||
|
- -XX:+UseG1GC
|
||||||
|
- -XX:MaxGCPauseMillis=200
|
||||||
|
- --spring.profiles.active=dev
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
@ -1,54 +1,18 @@
|
|||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
# 构建 MySQL数据库 这里不指定数据库文件 防止误操作 等隐患问题
|
|
||||||
opsli-boot-mysql:
|
|
||||||
build: ./db-file
|
|
||||||
image: opsli-boot-mysql
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
# root 账户默认密码 生产时请更改
|
|
||||||
MYSQL_ROOT_PASSWORD: 123456
|
|
||||||
MYSQL_ROOT_HOST: '%'
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
container_name: opsli-boot-mysql
|
|
||||||
command:
|
|
||||||
--character-set-server=utf8mb4
|
|
||||||
--collation-server=utf8mb4_general_ci
|
|
||||||
--explicit_defaults_for_timestamp=true
|
|
||||||
--lower_case_table_names=1
|
|
||||||
--max_allowed_packet=128M
|
|
||||||
--default-authentication-plugin=caching_sha2_password
|
|
||||||
volumes:
|
|
||||||
- /var/mysql/data:/var/lib/mysql #挂载 MySQL数据
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
|
|
||||||
# 构建 Redis
|
|
||||||
opsli-boot-redis:
|
|
||||||
image: redis:6.2.3
|
|
||||||
restart: always
|
|
||||||
container_name: opsli-boot-redis
|
|
||||||
environment:
|
|
||||||
TZ: Asia/Shanghai
|
|
||||||
LANG: en_US.UTF-8
|
|
||||||
command: redis-server /usr/local/etc/redis/redis.conf --appendonly yes # 表示通过挂载配置文件追加配置
|
|
||||||
volumes:
|
|
||||||
- /var/redis/data:/data #挂载 Redis数据
|
|
||||||
- /var/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf #挂载 Redis配置
|
|
||||||
ports:
|
|
||||||
- "6379:6379"
|
|
||||||
|
|
||||||
opsli-boot:
|
opsli-boot:
|
||||||
build: ./
|
build: ./
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
depends_on:
|
|
||||||
- opsli-boot-mysql
|
|
||||||
- opsli-boot-redis
|
|
||||||
container_name: opsli-boot
|
container_name: opsli-boot
|
||||||
image: opsli-boot
|
image: opsli-boot
|
||||||
environment:
|
environment:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
LANG: en_US.UTF-8
|
LANG: en_US.UTF-8
|
||||||
|
command:
|
||||||
|
- -Xmx2048m
|
||||||
|
- -Xms2048m
|
||||||
|
- -XX:+UseG1GC
|
||||||
|
- -XX:MaxGCPauseMillis=200
|
||||||
|
- --spring.profiles.active=dev
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
@ -1,82 +0,0 @@
|
|||||||
## ---- 测试环境 ---- ##
|
|
||||||
|
|
||||||
# 端口设置
|
|
||||||
server:
|
|
||||||
port: 8080
|
|
||||||
|
|
||||||
spring:
|
|
||||||
#redis 配置
|
|
||||||
redis:
|
|
||||||
database: 0
|
|
||||||
host: opsli-boot-redis
|
|
||||||
password: '123456'
|
|
||||||
port: 6379
|
|
||||||
|
|
||||||
# 数据库配置
|
|
||||||
datasource:
|
|
||||||
# 数据库连接池监控
|
|
||||||
druid:
|
|
||||||
stat-view-servlet:
|
|
||||||
# 数据库监控开关
|
|
||||||
enabled: true
|
|
||||||
# 登录用户名/密码
|
|
||||||
login-username: admin
|
|
||||||
login-password: 123456
|
|
||||||
# IP 白名单,没有配置或者为空,则允许所有访问
|
|
||||||
allow:
|
|
||||||
# IP 黑名单,若白名单也存在,则优先使用
|
|
||||||
deny:
|
|
||||||
# 多数据源
|
|
||||||
dynamic:
|
|
||||||
#主数据源
|
|
||||||
#设置默认的数据源或者数据源组,默认值即为master,如果你主从默认下主库的名称就是master可不定义此项。
|
|
||||||
#primary: master
|
|
||||||
datasource:
|
|
||||||
master:
|
|
||||||
url: jdbc:mysql://opsli-boot-mysql:3306/opsli-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
|
|
||||||
username: root
|
|
||||||
password: MYSQL0p9o8i7u
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
# 多数据源配置
|
|
||||||
#slave-datasource:
|
|
||||||
#url: jdbc:mysql://127.0.0.1:3306/opsli-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
|
|
||||||
#username: root
|
|
||||||
#password: 12345678
|
|
||||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
|
|
||||||
# Redisson 分布式锁
|
|
||||||
redisson:
|
|
||||||
lock:
|
|
||||||
server:
|
|
||||||
enable: true
|
|
||||||
type: standalone
|
|
||||||
address: "${spring.redis.host}:${spring.redis.port}"
|
|
||||||
password: "${spring.redis.password}"
|
|
||||||
database: ${spring.redis.database}
|
|
||||||
|
|
||||||
# knife4j 文档 配置
|
|
||||||
knife4j:
|
|
||||||
basic:
|
|
||||||
## 开启Swagger的Basic认证功能,默认是false
|
|
||||||
enable: false
|
|
||||||
## Basic认证用户名
|
|
||||||
username: admin
|
|
||||||
## Basic认证密码
|
|
||||||
password: 123456
|
|
||||||
|
|
||||||
# 是否生产环境 (生产环境默认屏蔽文档)
|
|
||||||
production: false
|
|
||||||
|
|
||||||
|
|
||||||
# opsli 自定义配置
|
|
||||||
opsli:
|
|
||||||
# 演示模式
|
|
||||||
enable-demo: true
|
|
||||||
# web 上传文件路径
|
|
||||||
web:
|
|
||||||
upload-path: /upload/files
|
|
||||||
|
|
||||||
# 系统日志
|
|
||||||
log:
|
|
||||||
path: /var/log
|
|
||||||
|
|
Loading…
Reference in new issue