Files
conti-backend/docker-compose.yml
T
2026-08-17 15:31:27 +08:00

38 lines
1.4 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.
# 本地开发依赖的外部组件。只起 MySQL——应用本身用 ./gradlew :bootstrap:bootRun 在 IDE/命令行里跑,
# 这样断点和热重载都还在。
#
# docker compose up -d mysql
# SPRING_PROFILES_ACTIVE=local ./gradlew :bootstrap:bootRun
#
# 这里的账号密码跟 application-local.yml 对齐,都是假值,不是任何环境的真实凭证。
services:
mysql:
image: mysql:8.4
container_name: conti-mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root_local_password
MYSQL_USER: conti
MYSQL_PASSWORD: conti_local_password
command:
# 字符集跟 UAT/Prod 的 Azure Flexible Server 对齐:8.0 之后的默认排序规则是
# utf8mb4_0900_ai_ci,本地用别的会出现"本地大小写敏感、线上不敏感"这类差异。
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_0900_ai_ci
# 应用侧全用 UTC Instant 存取(见 03-persistence.md),服务端时区也钉成 UTC
- --default-time-zone=+00:00
volumes:
- conti-mysql-data:/var/lib/mysql
# 一个 domain 一个 databaseFlyway 起来之前这几个库得先存在(见 DomainFlywayConfig
- ./docker/mysql/init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-proot_local_password"]
interval: 5s
timeout: 3s
retries: 20
volumes:
conti-mysql-data: