-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
133 lines (119 loc) · 2.98 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
133 lines (119 loc) · 2.98 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
services:
api:
build:
context: ./api
dockerfile: Dockerfile
ports:
- "8081:8081"
depends_on:
- rabbitmq
- redis
- speech
- database
volumes:
- ./api:/app
- ./logs:/api/logs
- ./services/common_dir:/speech/common_dir
- ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native
- ~/.config/pulse/cookie:/root/.config/pulse/cookie
environment:
- MQ_URL=${MQ_URL}
- REDIS_URL=${REDIS_URL}
- RMQ_USER=${RMQ_USER}
- RMQ_PWD=${RMQ_PWD}
- REDIS_PWD=${REDIS_PWD}
- DATABASE_API_URL=${DATABASE_API_URL}
- HOST=0.0.0.0
- PORT=8081
- PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native
devices:
- /dev/snd:/dev/snd
networks:
- vnet
command: uvicorn api:app --host 0.0.0.0 --port 8081
speech:
build:
context: ./services/speech
dockerfile: Dockerfile
container_name: speech
command: sh -c "celery -A src.celery_tasks.tasks worker -Q speech_ai_queue -n worker.speech --loglevel=info --concurrency=1 -E --logfile=/speech/logs/celery.log"
environment:
- MQ_URL=${MQ_URL}
- REDIS_URL=${REDIS_URL}
- RMQ_USER=${RMQ_USER}
- RMQ_PWD=${RMQ_PWD}
- REDIS_PWD=${REDIS_PWD}
# - PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native
volumes:
- ./services/speech/src:/speech/src
- ./logs:/speech/logs
- ./services/common_dir:/speech/common_dir
# - ${XDG_RUNTIME_DIR}/pulse/native:${XDG_RUNTIME_DIR}/pulse/native
# - ~/.config/pulse/cookie:/root/.config/pulse/cookie
networks:
- vnet
# devices:
# - /dev/snd:/dev/snd
privileged: true
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: ${GPU_COUNT}
capabilities: [gpu]
database:
build:
context: ./services/database
ports:
- "8000:8000"
environment:
- MONGO_URL=${DATABASE_URL}
volumes:
- ./logs:/database/logs
depends_on:
- mongodb
networks:
- vnet
command: uvicorn src.main:app --host 0.0.0.0 --port 8000
mongodb:
image: mongo:6.0
ports:
- 27017:27017
environment:
- MONGO_INITDB_ROOT_USERNAME=${DATABASE_USER}
- MONGO_INITDB_ROOT_PASSWORD=${DATABASE_PASSWORD}
networks:
- vnet
rabbitmq:
image: rabbitmq:3.12.13
ports:
- 5672:5672
- 15672:15672
environment:
- RABBITMQ_DEFAULT_USER=${RMQ_USER}
- RABBITMQ_DEFAULT_PASS=${RMQ_PWD}
networks:
- vnet
redis:
image: redis:7.2-rc-bullseye
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PWD}
ports:
- 6379:6379
networks:
- vnet
flower:
image: mher/flower:2.0
environment:
CELERY_BROKER_URL: ${MQ_URL}
FLOWER_PORT: 5555
ports:
- 5555:5555
networks:
- vnet
depends_on:
- rabbitmq
networks:
vnet:
name: speech_vnet