Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
167 lines (162 loc) · 6.39 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
167 lines (162 loc) · 6.39 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
services:
vault-agent:
image: hashicorp/vault@sha256:5be49781ecf78bfe775c5309c6a4d9f4e9e040b6c885c99eb2b12fb69855e1a2
container_name: dialogscribe-vault-agent
user: "10002:10003"
environment:
- SKIP_SETCAP=1
- HOME=/tmp
volumes:
- ./vault/agent.hcl:/etc/vault/agent.hcl:ro
- ./vault/secrets.env.tmpl:/etc/vault/secrets.env.tmpl:ro
- ./vault/role-id:/etc/vault/role-id:ro
- ./vault/secret-id:/etc/vault/secret-id:ro
- ./vault/secrets:/etc/vault/secrets
command: agent -config=/etc/vault/agent.hcl -log-level=info
restart: unless-stopped
networks:
- secrets-net
healthcheck:
test: ["CMD-SHELL", "test -f /etc/vault/secrets/secrets.json"]
interval: 5s
timeout: 3s
retries: 12
start_period: 10s
dialogscribe-web:
image: 192.168.1.47:7002/dialogscribe@sha256:1584bfc874fc3fd2611f4b2392a1df92f51bacef0b468ef707bb8a3f7328a66b
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
user: "10001:10003"
expose:
- "7860"
runtime: nvidia
depends_on:
vault-agent:
condition: service_healthy
entrypoint: ["/bin/sh", "/entrypoint.sh"]
command: ["python", "api.py"]
environment:
- ENVIRONMENT=production
- VAULT_SECRETS_FILE=/etc/vault/secrets/secrets.json
- PYANNOTE_MODEL=pyannote/speaker-diarization-3.1
# Fail-closed secrets: startup ABORTS in production when JWT_SECRET is
# missing/short (<32 chars), or when V1_API_ENABLED=true without a
# strong API_KEY distinct from JWT_SECRET. JWT_SECRET may come from the
# host environment or from Vault (vault/secrets.env.tmpl); API_KEY is
# only required when V1_API_ENABLED=true.
- JWT_SECRET=${JWT_SECRET:-}
- API_KEY=${API_KEY:-}
- V1_API_ENABLED=${V1_API_ENABLED:-false}
- MAX_UPLOAD_SIZE_MB=${MAX_UPLOAD_SIZE_MB:-2048}
# 600s keeps a single ASR request ≤19.2MB (16kHz-mono WAV); the ASR backend rejects files >25MiB
- TRANSCRIPTION_CHUNK_THRESHOLD_SEC=${TRANSCRIPTION_CHUNK_THRESHOLD_SEC:-600}
- TRANSCRIPTION_CHUNK_DURATION_SEC=${TRANSCRIPTION_CHUNK_DURATION_SEC:-300}
- DATABASE_URL=${DATABASE_URL:-}
- ADMIN_EMAIL=${ADMIN_EMAIL:-}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
- SMTP_HOST=${SMTP_HOST:-smtp.mail.ru}
- SMTP_PORT=${SMTP_PORT:-465}
- SMTP_USER=${SMTP_USER:-}
- SMTP_PASSWORD=${SMTP_PASSWORD:-}
- SMTP_FROM=${SMTP_FROM:-}
- SMTP_USE_TLS=${SMTP_USE_TLS:-true}
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:5173}
# Live streaming opt-in (plan task 6). window = legacy v1 path only, the
# sidecar is never contacted and v2 is never advertised. stream = advertise
# pcm_stream_v2; set LIVE_ASR_CANARY_USER_ID to limit it to one user until
# the real-traffic go. Not secrets: plain host/.env variables.
- LIVE_ASR_MODE=${LIVE_ASR_MODE:-window}
- LIVE_ASR_ENDPOINT=${LIVE_ASR_ENDPOINT:-ws://live-asr:8080}
- LIVE_ASR_CANARY_USER_ID=${LIVE_ASR_CANARY_USER_ID:-}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:7860/health'); print('healthy')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 120s
volumes:
- ./data:/app/data
- ./samples:/app/samples:ro
- ./vault/secrets:/etc/vault/secrets:ro
- ./entrypoint.sh:/entrypoint.sh:ro
- hf-cache:/home/appuser/.cache
# host video/render GIDs — verify with ls -l /dev/nvidia*
# group_add: ["44", "107"]
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ["all"]
capabilities: [gpu]
networks:
# default keeps the ingress-guard -> web resolution working;
# live-asr-net is the internal-only network shared with the sidecar.
- default
- live-asr-net
# Opt-in live ASR sidecar (plan task 6). Inactive unless the "live-asr"
# profile is selected, so the default `docker compose up` never creates it
# and the web service runs exactly as before. Every variable deliberately
# uses `:-` with a self-describing sentinel: `${VAR:?}` is interpolated
# eagerly and breaks `docker compose config`/`ps` even while the profile is
# inactive, whereas the sentinels fail closed only when the profile is
# actually started without the variable set.
live-asr:
# Jenkins-built digest only (services/live-asr/Dockerfile.gpu); never a tag.
image: ${LIVE_ASR_IMAGE:-}
profiles: ["live-asr"]
restart: unless-stopped
user: "10001:10003"
environment:
- LIVE_ASR_DEVICE=cuda
volumes:
# Read-only model cache (HF_HUB_OFFLINE=1 in the image); never auto-created.
- type: bind
source: ${LIVE_ASR_CACHE_DIR:-/opt/dialogscribe/LIVE_ASR_CACHE_DIR-is-not-set}
target: /models/gigaam
read_only: true
bind:
create_host_path: false
healthcheck:
test: ['CMD', 'python', '-c', 'import sys,urllib.request; o=urllib.request.build_opener(urllib.request.ProxyHandler({})); sys.exit(0 if o.open("http://127.0.0.1:8080/healthz", timeout=2).status == 200 else 1)']
interval: 30s
timeout: 3s
retries: 3
start_period: 600s
deploy:
resources:
# Planning defaults, unverified on Arch: CPU/RAM headroom is measured
# before the canary and tightened through the same reviewed PR.
limits:
cpus: "${LIVE_ASR_CPUS:-4.0}"
memory: ${LIVE_ASR_MEMORY:-8g}
reservations:
devices:
# Exactly one reviewed GPU UUID; unset/empty fails container start.
- driver: nvidia
device_ids: ["${LIVE_ASR_GPU_UUID:-LIVE_ASR_GPU_UUID-is-not-set}"]
capabilities: [gpu]
networks:
- live-asr-net
ingress-guard:
image: nginx@sha256:65645c7bb6a0661892a8b03b89d0743208a18dd2f3f17a54ef4b76fb8e2f2a10
container_name: dialogscribe-ingress-guard
ports:
- "192.168.1.48:7860:80"
volumes:
- ./deploy/ingress-guard.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
dialogscribe-web:
condition: service_healthy
restart: unless-stopped
networks:
secrets-net:
external: true
# Internal-only (no gateway/egress): shared solely by dialogscribe-web and
# the live-asr sidecar, which publishes no host port.
live-asr-net:
internal: true
volumes:
hf-cache: