-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
88 lines (83 loc) · 2.12 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
88 lines (83 loc) · 2.12 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# ============================================
# ECS Platform - Production Docker Compose
# ============================================
version: "3.9"
services:
# PostgreSQL + pgvector
postgres:
image: pgvector/pgvector:pg16
container_name: ecs-postgres-prod
environment:
POSTGRES_USER: ${DB_USER:-ecs}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME:-ecs_platform}
ports:
- "5432:5432"
volumes:
- pgdata_prod:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-ecs}"]
interval: 10s
timeout: 5s
retries: 5
# Redis
redis:
image: redis:7-alpine
container_name: ecs-redis-prod
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
ports:
- "6379:6379"
volumes:
- redisdata_prod:/data
restart: always
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
# NestJS API
api:
build:
context: .
dockerfile: packages/api/Dockerfile
container_name: ecs-api-prod
environment:
NODE_ENV: production
PORT: 4000
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${DB_USER:-ecs}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME:-ecs_platform}
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
JWT_SECRET: ${JWT_SECRET}
CLAUDE_API_KEY: ${CLAUDE_API_KEY}
OPENAI_API_KEY: ${OPENAI_API_KEY}
FRONTEND_URL: ${FRONTEND_URL}
ports:
- "4000:4000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: always
# MinIO (文件存储)
minio:
image: minio/minio:latest
container_name: ecs-minio-prod
environment:
MINIO_ROOT_USER: ${MINIO_USER:-admin}
MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata_prod:/data
command: server /data --console-address ":9001"
restart: always
volumes:
pgdata_prod:
redisdata_prod:
miniodata_prod: