-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
150 lines (141 loc) · 3.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
150 lines (141 loc) · 3.74 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# HRBP AI Workbench — Docker Compose production-like stack
# FastAPI + PostgreSQL + Redis + MinIO + Milvus + React (Nginx)
#
# Usage:
# docker compose up -d
# docker compose logs -f
#
# Environment: copy backend/env.docker to backend/.env and edit before starting.
services:
# --- PostgreSQL ---
postgres:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: hrbp
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-hrbp_password}
POSTGRES_DB: hrbp_workbench
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U hrbp"]
interval: 5s
timeout: 5s
retries: 5
# --- Redis ---
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
# --- MinIO (S3-compatible object storage) ---
minio:
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
ports:
- "9000:9000" # API
- "9001:9001" # Console
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
# --- Milvus (vector database) ---
milvus-etcd:
image: quay.io/coreos/etcd:v3.5.5
restart: unless-stopped
environment:
ETCD_AUTO_COMPACTION_MODE: revision
ETCD_AUTO_COMPACTION_RETENTION: "1000"
ETCD_QUOTA_BACKEND_BYTES: "4294967296"
volumes:
- milvus_etcd:/etcd
milvus-minio:
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9002"
environment:
MINIO_ROOT_USER: milvus
MINIO_ROOT_PASSWORD: milvus123
volumes:
- milvus_minio_data:/data
milvus:
image: milvusdb/milvus:v2.4.0
restart: unless-stopped
command: ["milvus", "run", "standalone"]
environment:
ETCD_ENDPOINTS: milvus-etcd:2379
MINIO_ADDRESS: milvus-minio:9000
ports:
- "19530:19530" # gRPC API
- "9091:9091" # Metrics
depends_on:
- milvus-etcd
- milvus-minio
volumes:
- milvus_data:/var/lib/milvus
# --- FastAPI backend ---
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "8000:8000"
env_file:
- ./backend/env.docker
environment:
APP_ENV: ${APP_ENV:-production}
POSTGRES_HOST: postgres
REDIS_HOST: redis
VECTOR_DB_HOST: milvus
MINIO_ENDPOINT: minio:9000
# Override connection strings for container networking
DATABASE_URL: postgresql+asyncpg://hrbp:${POSTGRES_PASSWORD:-hrbp_password}@postgres:5432/hrbp_workbench
REDIS_URL: redis://redis:6379/0
VECTOR_DB_PORT: 19530
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
# No volume mount in production — use image-built code
# Dev: uncomment to enable hot-reload:
# volumes:
# - ./backend:/app
# --- React frontend (Nginx) ---
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "5173:5173"
depends_on:
- backend
# Start after backend is healthy
# Nginx serves static SPA + proxies /api/* to backend:8000
volumes:
postgres_data:
redis_data:
minio_data:
milvus_etcd:
milvus_minio_data:
milvus_data: