58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
|
version: '3'
|
||
|
|
||
|
services:
|
||
|
|
||
|
mysql:
|
||
|
image: mysql:8.0.34
|
||
|
container_name: qnc_mysql
|
||
|
environment:
|
||
|
# 时区上海 - Time zone Shanghai (Change if needed)
|
||
|
TZ: Asia/Shanghai
|
||
|
# root 密码 - root password
|
||
|
MYSQL_ROOT_PASSWORD: eh:GiX%cWyiV$WF_
|
||
|
MYSQL_DATABASE: qnc
|
||
|
MYSQL_USER: qnc
|
||
|
MYSQL_PASSWORD: V3j@K9!qL5#wX4$p
|
||
|
ports:
|
||
|
- "20001:3306"
|
||
|
volumes:
|
||
|
# 数据挂载 - Data mounting
|
||
|
- ./data/mysql/data:/var/lib/mysql
|
||
|
# 日志
|
||
|
command:
|
||
|
# 将mysql8.0默认密码策略 修改为 原先 策略 (mysql8.0对其默认策略做了更改 会导致密码无法匹配)
|
||
|
# Modify the Mysql 8.0 default password strategy to the original strategy (MySQL8.0 to change its default strategy will cause the password to be unable to match)
|
||
|
--default-authentication-plugin=mysql_native_password
|
||
|
--character-set-server=utf8mb4
|
||
|
--collation-server=utf8mb4_general_ci
|
||
|
--explicit_defaults_for_timestamp=true
|
||
|
--lower_case_table_names=1
|
||
|
privileged: true
|
||
|
restart: always
|
||
|
networks:
|
||
|
- qnc_net
|
||
|
|
||
|
#redis容器 - Redis container
|
||
|
redis:
|
||
|
image: redis:6.2.5
|
||
|
container_name: qnc_redis
|
||
|
ports:
|
||
|
- "20002:6379"
|
||
|
environment:
|
||
|
# 时区上海 - Time zone Shanghai (Change if needed)
|
||
|
TZ: Asia/Shanghai
|
||
|
volumes:
|
||
|
# 数据文件 - data files
|
||
|
- ./data/redis/data:/data:rw
|
||
|
command: "redis-server --requirepass A!02Myl>H}ZQfpxC --appendonly yes"
|
||
|
privileged: true
|
||
|
restart: always
|
||
|
networks:
|
||
|
- qnc_net
|
||
|
|
||
|
|
||
|
networks:
|
||
|
qnc_net:
|
||
|
driver: bridge
|
||
|
|