youtu_ecpm/docker-compose.yaml
2025-01-18 17:56:36 +08:00

32 lines
943 B
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.

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:
#数据目录,要确保先创建好
- ./data/mysql/data:/var/lib/mysql
- ./data/mysql/logs:/var/log/mysql
##初始化的脚本初始化我们存放的init.sql文件
- ./data/mysql/initdb:/docker-entrypoint-initdb.d/
- ./data/mysql/conf:/etc/mysql/conf.d
ports:
- "3306:3306"
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-uyoutu", "-pyoutu!0113" ]
interval: 6s
timeout: 5s
retries: 10
#network_mode: host