50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
# 智能办事助手 - 本地开发依赖
|
||
# 启动:docker compose up -d 停止:docker compose down
|
||
# 数据在命名卷里,down 不删数据;清库用 docker compose down -v
|
||
# 2026-09-17 起数据库为 PostgreSQL 17;mysql 仅作迁移期 legacy(docker compose --profile legacy up -d mysql)
|
||
name: school-assistant
|
||
|
||
services:
|
||
postgres:
|
||
image: postgres:17.10-alpine
|
||
container_name: school-assistant-postgres
|
||
restart: unless-stopped
|
||
ports:
|
||
- "127.0.0.1:15433:5432"
|
||
environment:
|
||
POSTGRES_DB: school_assistant
|
||
POSTGRES_USER: assistant
|
||
POSTGRES_PASSWORD: assistant_dev_123
|
||
TZ: Asia/Shanghai
|
||
PGTZ: Asia/Shanghai
|
||
volumes:
|
||
- pg_data:/var/lib/postgresql/data
|
||
healthcheck:
|
||
test: ["CMD-SHELL", "pg_isready -U assistant -d school_assistant"]
|
||
interval: 5s
|
||
timeout: 5s
|
||
retries: 20
|
||
|
||
mysql:
|
||
profiles: ["legacy"]
|
||
image: mysql:8.4.11
|
||
container_name: school-assistant-mysql
|
||
restart: unless-stopped
|
||
ports:
|
||
- "127.0.0.1:13307:3306"
|
||
environment:
|
||
MYSQL_ROOT_PASSWORD: root_dev_123
|
||
MYSQL_DATABASE: school_assistant
|
||
MYSQL_USER: assistant
|
||
MYSQL_PASSWORD: assistant_dev_123
|
||
TZ: Asia/Shanghai
|
||
command:
|
||
- --character-set-server=utf8mb4
|
||
- --collation-server=utf8mb4_unicode_ci
|
||
volumes:
|
||
- mysql_data:/var/lib/mysql
|
||
|
||
volumes:
|
||
pg_data:
|
||
mysql_data:
|