forked from LaansDole/stt-to-medical
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.gpu.yaml
More file actions
185 lines (178 loc) · 5.32 KB
/
docker-compose.gpu.yaml
File metadata and controls
185 lines (178 loc) · 5.32 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
version: '3.8'
services:
temporal:
image: temporalio/auto-setup:latest
ports:
- "7233:7233"
environment:
- DB=postgres12
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=postgres
- DBNAME=temporal
- VISIBILITY_DBNAME=temporal_visibility
# Workflow retention: 7 days (168 hours)
- DEFAULT_NAMESPACE_RETENTION=168h
depends_on:
- postgres
networks:
- whisperx-network
healthcheck:
test: ["CMD", "tctl", "--address", "temporal:7233", "cluster", "health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 90s
postgres:
image: postgres:13
environment:
- POSTGRES_PASSWORD=temporal
- POSTGRES_USER=temporal
- POSTGRES_DB=temporal
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- whisperx-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U temporal"]
interval: 10s
timeout: 5s
retries: 5
# WhisperX FastAPI Application with GPU
whisperx-api:
build:
context: .
dockerfile: Dockerfile
args:
- INSTALL_GPU=true
ports:
- "8000:8000"
environment:
# Secrets from .env
- HF_TOKEN=${HF_TOKEN:-}
- ENVIRONMENT=${ENVIRONMENT:-production}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- DIARIZATION_MODEL_PATH=${DIARIZATION_MODEL_PATH:-}
- TEMPORAL_SERVER_URL=temporal:7233
- HIPAA_ENCRYPTION_KEY=${HIPAA_ENCRYPTION_KEY:-default}
# LM Studio configuration for medical processing (host.docker.internal for Docker-to-host connectivity)
- LM_STUDIO_BASE_URL=${LM_STUDIO_BASE_URL:-http://host.docker.internal:1234/v1}
- LM_STUDIO_MODEL=${LM_STUDIO_MODEL:-}
- LM_STUDIO_MAX_TOKENS=${LM_STUDIO_MAX_TOKENS:-8192}
- EMBEDDING_MODEL=${EMBEDDING_MODEL:-text-embedding-bge-reranker-v2-m3}
- EMBEDDING_DIMENSION=${EMBEDDING_DIMENSION:-1024}
volumes:
# Config file (runtime defaults)
- ./config.yaml:/app/config.yaml:ro
# Model cache
- whisperx-huggingface-cache:/root/.cache/huggingface
- whisperx-torch-cache:/root/.cache/torch
# Shared file uploads (Docker volume, not host directory)
- whisperx-uploads:/tmp/uploads
# Data persistence
- ./vector_storage:/app/vector_storage
- ./data:/app/data
- ./audit_logs:/app/audit_logs
depends_on:
temporal:
condition: service_healthy
networks:
- whisperx-network
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Temporal Worker with GPU
whisperx-worker:
build:
context: .
dockerfile: Dockerfile
args:
- INSTALL_GPU=true
stop_grace_period: 30s
environment:
# Secrets from .env
- HF_TOKEN=${HF_TOKEN:-}
- ENVIRONMENT=${ENVIRONMENT:-production}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- DIARIZATION_MODEL_PATH=${DIARIZATION_MODEL_PATH:-}
- TEMPORAL_SERVER_URL=temporal:7233
- HIPAA_ENCRYPTION_KEY=${HIPAA_ENCRYPTION_KEY:-default}
# LM Studio configuration for medical processing (host.docker.internal for Docker-to-host connectivity)
- LM_STUDIO_BASE_URL=${LM_STUDIO_BASE_URL:-http://host.docker.internal:1234/v1}
- LM_STUDIO_MODEL=${LM_STUDIO_MODEL:-}
- LM_STUDIO_MAX_TOKENS=${LM_STUDIO_MAX_TOKENS:-8192}
- EMBEDDING_MODEL=${EMBEDDING_MODEL:-text-embedding-bge-reranker-v2-m3}
- EMBEDDING_DIMENSION=${EMBEDDING_DIMENSION:-1024}
volumes:
# Config file (runtime defaults)
- ./config.yaml:/app/config.yaml:ro
# Model cache
- whisperx-huggingface-cache:/root/.cache/huggingface
- whisperx-torch-cache:/root/.cache/torch
# File processing (Docker volume)
- whisperx-uploads:/tmp/uploads
# Data persistence
- ./vector_storage:/app/vector_storage
- ./data:/app/data
- ./audit_logs:/app/audit_logs
command: ["uv", "run", "python", "-m", "app.temporal.worker"]
depends_on:
temporal:
condition: service_healthy
networks:
- whisperx-network
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
deploy:
replicas: 1
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
streamlit-ui:
build:
context: .
dockerfile: Dockerfile.streamlit
ports:
- "8501:8501"
environment:
- WHISPERX_API_URL=http://whisperx-api:8000
volumes:
- ./streamlit_app:/app/streamlit_app
depends_on:
whisperx-api:
condition: service_healthy
networks:
- whisperx-network
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8501/_stcore/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
whisperx-network:
driver: bridge
volumes:
postgres-data:
whisperx-huggingface-cache:
whisperx-torch-cache:
whisperx-uploads: