2025-01-20 01:55:44 +08:00
|
|
|
|
version: "3"
|
|
|
|
|
services:
|
|
|
|
|
mysql:
|
|
|
|
|
image: mysql
|
|
|
|
|
container_name: mysql
|
|
|
|
|
restart: always
|
|
|
|
|
command: [
|
|
|
|
|
'--character-set-server=utf8mb4',
|
|
|
|
|
'--collation-server=utf8mb4_general_ci',
|
|
|
|
|
'--explicit_defaults_for_timestamp=true',
|
|
|
|
|
'--lower_case_table_names=1'
|
|
|
|
|
]
|
|
|
|
|
environment:
|
|
|
|
|
MYSQL_ROOT_PASSWORD: youtu!0113
|
|
|
|
|
MYSQL_INITDB_SKIP_TZINFO: "Asia/Shanghai"
|
|
|
|
|
MYSQL_DATABASE: ecpm
|
|
|
|
|
volumes:
|
|
|
|
|
#数据目录,要确保先创建好
|
2025-01-21 18:03:59 +08:00
|
|
|
|
- ./mysql/data:/var/lib/mysql
|
|
|
|
|
- ./mysql/logs:/var/log/mysql
|
|
|
|
|
- ./mysql/conf:/etc/mysql/conf.d
|
2025-01-20 01:55:44 +08:00
|
|
|
|
##初始化的脚本,初始化我们存放的init.sql文件
|
2025-01-21 18:03:59 +08:00
|
|
|
|
- ./sql:/docker-entrypoint-initdb.d/
|
2025-01-20 01:55:44 +08:00
|
|
|
|
healthcheck:
|
|
|
|
|
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-uyoutu", "-pyoutu!0113" ]
|
|
|
|
|
interval: 6s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 10
|
|
|
|
|
#network_mode: host
|
|
|
|
|
redis:
|
|
|
|
|
image: redis
|
|
|
|
|
restart: always
|
|
|
|
|
hostname: redis
|
|
|
|
|
container_name: redis
|
|
|
|
|
privileged: true
|
|
|
|
|
environment:
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
volumes:
|
|
|
|
|
- ./data/redis:/data
|
|
|
|
|
# - ./conf/redis.conf:/etc/redis/redis.conf
|
|
|
|
|
- ./data/redis/logs:/logs
|
|
|
|
|
# command: [ "redis-server","/etc/redis/redis.conf" ]
|
2025-01-21 18:03:59 +08:00
|
|
|
|
youtu_server:
|
|
|
|
|
image: youtu_server:v1
|
|
|
|
|
container_name: youtu_server
|
|
|
|
|
ports:
|
|
|
|
|
- "8888:8888"
|
|
|
|
|
environment:
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
restart: always
|
|
|
|
|
depends_on:
|
|
|
|
|
- mysql
|
|
|
|
|
- redis
|
|
|
|
|
volumes:
|
|
|
|
|
- ./server/config.yaml:/app/etc/game_open_api-api.yaml
|
|
|
|
|
- ./server/logs:/logs
|