-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
252 lines (243 loc) · 7.18 KB
/
docker-compose.yml
File metadata and controls
252 lines (243 loc) · 7.18 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
services:
postgres:
image: postgres:16-alpine
container_name: dwp-postgres
environment:
POSTGRES_DB: ${POSTGRES_DB:-digital_workforce}
POSTGRES_USER: ${POSTGRES_USER:-dwp_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-dwp_password_change_me}
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=en_US.UTF-8"
volumes:
- ./data/postgres:/var/lib/postgresql/data
- ./infrastructure/scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-dwp_user} -d ${POSTGRES_DB:-digital_workforce}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- dwp-backend
- dwp-data
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: dwp-redis
command: >
redis-server
--appendonly yes
--appendfsync everysec
--maxmemory 512mb
--maxmemory-policy allkeys-lru
--requirepass ${REDIS_PASSWORD:-redis_password_change_me}
volumes:
- ./data/redis:/data
ports:
- "${REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD-SHELL", "redis-cli --no-auth-warning -a \"${REDIS_PASSWORD:-redis_password_change_me}\" ping | grep PONG"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
networks:
- dwp-backend
- dwp-data
restart: unless-stopped
minio:
image: minio/minio:latest
container_name: dwp-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin_change_me}
MINIO_BROWSER_REDIRECT_URL: ${MINIO_BROWSER_URL:-http://localhost:9001}
volumes:
- ./data/minio:/data
ports:
- "${MINIO_API_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
start_period: 10s
networks:
- dwp-backend
- dwp-data
restart: unless-stopped
etcd:
image: quay.io/coreos/etcd:v3.5.25
container_name: dwp-etcd
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- ./data/etcd:/etcd
command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 30s
timeout: 20s
retries: 3
start_period: 10s
networks:
- dwp-data
restart: unless-stopped
minio-milvus:
image: minio/minio:RELEASE.2024-12-18T13-15-44Z
container_name: dwp-minio-milvus
environment:
MINIO_ROOT_USER: ${MILVUS_MINIO_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MILVUS_MINIO_PASSWORD:-minioadmin}
volumes:
- ./data/minio-milvus:/data
command: minio server /data --console-address ":9002"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
start_period: 10s
networks:
- dwp-data
restart: unless-stopped
milvus:
image: milvusdb/milvus:v2.6.11
container_name: dwp-milvus
command: ["milvus", "run", "standalone"]
environment:
MINIO_REGION: us-east-1
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio-milvus:9000
MINIO_ACCESS_KEY_ID: ${MILVUS_MINIO_USER:-minioadmin}
MINIO_SECRET_ACCESS_KEY: ${MILVUS_MINIO_PASSWORD:-minioadmin}
volumes:
- ./data/milvus:/var/lib/milvus
ports:
- "${MILVUS_PORT:-19530}:19530"
- "${MILVUS_METRICS_PORT:-9091}:9091"
depends_on:
etcd:
condition: service_healthy
minio-milvus:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
interval: 30s
timeout: 20s
retries: 5
start_period: 90s
networks:
- dwp-backend
- dwp-data
restart: unless-stopped
# Application Services
api-gateway:
build:
context: .
dockerfile: infrastructure/docker/Dockerfile.api-gateway
container_name: dwp-api-gateway
group_add:
- "0"
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=${POSTGRES_DB:-digital_workforce}
- POSTGRES_USER=${POSTGRES_USER:-dwp_user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-dwp_password_change_me}
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD:-redis_password_change_me}
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=${MINIO_ROOT_USER:-minioadmin}
- MINIO_SECRET_KEY=${MINIO_ROOT_PASSWORD:-minioadmin_change_me}
- MILVUS_HOST=milvus
- MILVUS_PORT=19530
- JWT_SECRET=${JWT_SECRET:-change_me_in_production}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- LINX_SANDBOX_PYTHON_IMAGE=${LINX_SANDBOX_PYTHON_IMAGE:-linx/sandbox-runtime:py312-office}
- LINX_SANDBOX_TMPFS_SIZE=${LINX_SANDBOX_TMPFS_SIZE:-1G}
- LINX_SANDBOX_IO_DEVICE_PATH=${LINX_SANDBOX_IO_DEVICE_PATH:-}
volumes:
- ./backend:/app
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "${API_PORT:-8000}:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
milvus:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- dwp-frontend
- dwp-backend
restart: unless-stopped
funasr-service:
build:
context: .
dockerfile: infrastructure/docker/Dockerfile.funasr-service
container_name: dwp-funasr-service
profiles:
- funasr
environment:
- FUNASR_MODEL=${FUNASR_MODEL:-iic/SenseVoiceSmall}
- FUNASR_AUTH_TOKEN=${FUNASR_AUTH_TOKEN:-}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
volumes:
- ./data/funasr-model-cache:/root/.cache
ports:
- "${FUNASR_SERVICE_PORT:-10095}:10095"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:10095/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
networks:
- dwp-backend
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: dwp-frontend
environment:
- VITE_API_URL=http://localhost:8000
ports:
- "${FRONTEND_PORT:-3000}:80"
depends_on:
api-gateway:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- dwp-frontend
restart: unless-stopped
networks:
dwp-frontend:
driver: bridge
dwp-backend:
driver: bridge
dwp-data:
driver: bridge
internal: true