-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdocker-compose-dev.yml
More file actions
56 lines (52 loc) · 1.43 KB
/
docker-compose-dev.yml
File metadata and controls
56 lines (52 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# AgomSADF 开发环境 Docker Compose 配置
# 仅包含 PostgreSQL 和 Redis,Django 应用在本地运行
# 适用于 Windows 开发环境
services:
# PostgreSQL 数据库
postgres:
image: postgres:15-alpine
container_name: agomtradepro_postgres_dev
restart: unless-stopped
environment:
POSTGRES_DB: agomtradepro
POSTGRES_USER: agomtradepro
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
# 优化 PostgreSQL 性能
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C"
volumes:
# 持久化数据到本地目录
- postgres_dev_data:/var/lib/postgresql/data
ports:
- "5433:5432" # 使用 5433 端口避免与 wanderwise_postgres 冲突
healthcheck:
test: ["CMD-SHELL", "pg_isready -U agomtradepro -d agomtradepro"]
interval: 10s
timeout: 5s
retries: 5
# Windows 兼容性:确保容器正确关闭
stop_grace_period: 10s
# Redis 服务(用于 Celery)
redis:
image: redis:7-alpine
container_name: agomtradepro_redis_dev
restart: unless-stopped
command: >
redis-server
--save ""
--appendonly no
--maxmemory 256mb
--maxmemory-policy allkeys-lru
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
# 命名卷
volumes:
postgres_dev_data:
driver: local
networks:
default:
name: agomtradepro_dev_network