2026-01-21 23:06:47 +01:00
|
|
|
|
version: '3.8'
|
|
|
|
|
|
|
|
|
|
|
|
# 开发环境 Docker Compose
|
|
|
|
|
|
# 使用方法: docker-compose -f docker-compose.dev.yml up -d
|
|
|
|
|
|
|
|
|
|
|
|
services:
|
2026-03-18 17:18:23 +08:00
|
|
|
|
# PostgreSQL 数据库(pg17 + pgvector,memory 模块需要 vector 类型)
|
2026-01-21 23:21:36 +01:00
|
|
|
|
postgres:
|
2026-03-18 17:18:23 +08:00
|
|
|
|
image: pgvector/pgvector:pg17
|
2026-01-21 23:21:36 +01:00
|
|
|
|
container_name: life-echo-postgres-dev
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "5432: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)
|
2026-01-21 23:06:47 +01:00
|
|
|
|
redis:
|
|
|
|
|
|
image: redis:7-alpine
|
|
|
|
|
|
container_name: life-echo-redis-dev
|
|
|
|
|
|
ports:
|
|
|
|
|
|
- "6379:6379"
|
|
|
|
|
|
volumes:
|
|
|
|
|
|
- redis_data_dev:/data
|
|
|
|
|
|
command: redis-server --appendonly yes
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
healthcheck:
|
|
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
|
|
interval: 10s
|
|
|
|
|
|
timeout: 5s
|
|
|
|
|
|
retries: 5
|
|
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
|
default:
|
|
|
|
|
|
name: life-echo-dev
|
|
|
|
|
|
|
|
|
|
|
|
volumes:
|
2026-01-21 23:21:36 +01:00
|
|
|
|
postgres_data_dev:
|
|
|
|
|
|
driver: local
|
2026-01-21 23:06:47 +01:00
|
|
|
|
redis_data_dev:
|
|
|
|
|
|
driver: local
|