Files
life-echo/api/docker-compose.dev.yml
Sully 53e0065e3e refactor(api): TOML 配置 SSOT、统一错误契约、Auth/事务加固与可观测性 (#33)
配置 SSOT(TOML + .env)
统一错误契约
Auth 与事务边界
Redis / Celery 可靠性:业务 Redis(DB/0)与 Celery broker/backend(DB/1)显式拆分;连接池、sync client
可观测性(OpenTelemetry + LGTM)
2026-05-22 13:44:50 +08:00

61 lines
1.7 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.
# 开发环境 Docker Compose
# 使用方法: docker compose -f docker-compose.dev.yml up -d
#
# 宿主端口为项目约定的固定高位端口(避免与本机常用 5432/6379 冲突),与本仓库 .env.example 对齐:
# PostgreSQL 127.0.0.1:48291 → 容器 5432
# Redis 127.0.0.1:48307 → 容器 6379
services:
# PostgreSQL 数据库pg17 + pgvectormemory 模块需要 vector 类型)
postgres:
image: pgvector/pgvector:pg17
container_name: life-echo-postgres-dev
ports:
- "48291:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: life_echo
volumes:
- postgres_data_dev:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Redis 服务(用于会话存储和 Celery
redis:
image: redis:7-alpine
container_name: life-echo-redis-dev
ports:
- "48307:6379"
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
volumes:
- redis_data_dev:/data
command: >
sh -c 'exec redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
$${REDIS_PASSWORD:+--requirepass "$$REDIS_PASSWORD"}'
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
'if [ -n "$$REDIS_PASSWORD" ]; then redis-cli -a "$$REDIS_PASSWORD" ping | grep -q PONG; else redis-cli ping | grep -q PONG; fi',
]
interval: 10s
timeout: 5s
retries: 5
networks:
default:
name: life-echo-dev
volumes:
postgres_data_dev:
driver: local
redis_data_dev:
driver: local