-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
119 lines (113 loc) · 2.74 KB
/
docker-compose.yml
File metadata and controls
119 lines (113 loc) · 2.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
services:
speech-postgres:
image: postgres:16-alpine
container_name: speech-postgres
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: ${DB_NAME}
ports:
- "127.0.0.1:5432:5432"
networks:
- speech-network
volumes:
- speech-postgres-data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}" ]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
speech-redis:
image: redis:7-alpine
container_name: speech-redis
ports:
- "127.0.0.1:6379:6379"
networks:
- speech-network
volumes:
- speech-redis-data:/data
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping || exit 1" ]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
migrate:
build:
context: .
dockerfile: docker/Dockerfile.api
image: speech-migrate:latest
container_name: speech-migrate
env_file:
- .env
command: [ "uv", "run", "alembic", "upgrade", "head" ]
networks:
- speech-network
depends_on:
speech-postgres:
condition: service_healthy
restart: no
speech-api:
build:
context: .
dockerfile: docker/Dockerfile.api
image: speech-api:latest
container_name: speech-api
env_file:
- .env
ports:
- "127.0.0.1:8080:8080"
networks:
- speech-network
volumes:
- transcribe:/srv/transcribe
environment:
- TRANSCRIBE_TMP_DIR=/srv/transcribe
depends_on:
migrate:
condition: service_completed_successfully
speech-redis:
condition: service_started
# restart: unless-stopped
speech-celery-worker:
build:
context: .
# dockerfile: docker/Dockerfile.worker.cuda
dockerfile: docker/Dockerfile.worker
image: speech-celery-worker:latest
container_name: speech-worker
env_file:
- .env
networks:
- speech-network
volumes:
- transcribe:/srv/transcribe
environment:
- TRANSCRIBE_TMP_DIR=/srv/transcribe
# - NVIDIA_VISIBLE_DEVICES=0
depends_on:
speech-postgres:
condition: service_healthy
speech-redis:
condition: service_started
migrate:
condition: service_completed_successfully
# restart: unless-stopped
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# capabilities: ["gpu"]
# device_ids: ["0"]
networks:
speech-network:
name: speech-network
volumes:
speech-postgres-data:
name: speech-postgres-data
speech-redis-data:
name: speech-redis-data
transcribe:
name: speech-transcribe