-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
164 lines (161 loc) · 3.94 KB
/
docker-compose.prod.yml
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
x-transcoder: &transcoder-base
image: ghcr.io/zoriya/kyoo_transcoder:edge
networks:
default:
aliases:
- transcoder
restart: unless-stopped
environment:
- GOCODER_PREFIX=/videos
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_SCHEMA=gocoder
- POSTGRES_SERVER=db
volumes:
- ${DATA_DIR}:/videos:ro
- ${CACHE_ROOT}:/cache
- metadata:/metadata
# This compose allows to build the whole project in a "production"-like environment
services:
front:
image: arthichaud/blee-front:edge
restart: on-failure
depends_on:
api:
condition: service_healthy
environment:
- SSR_SERVER_URL=http://api:8000
- SSR_TRANSCODER_URL=http://transcoder:7666
- SSR_SCANNER_URL=http://scanner:8133
ports:
- "3000:3000"
api:
image: arthichaud/blee-api:edge
ports:
- "8000:8000"
restart: on-failure
depends_on:
db:
condition: service_healthy
mq:
condition: service_healthy
volumes:
- data:${CONFIG_DIR}
environment:
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- RABBIT_HOST=mq
- RABBIT_PORT=5672
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "wget -qO- localhost:8000"]
interval: 5s
retries: 3
mq:
image: rabbitmq:3.13-alpine
environment:
- RABBITMQ_DEFAULT_USER=${RABBIT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBIT_PASS}
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 3s
retries: 10
scanner:
image: arthichaud/blee-scanner:edge
depends_on:
api:
condition: service_healthy
expose:
- "8133"
volumes:
- ${DATA_DIR}:/videos:ro
- ./scanner.json:/app/scanner.json
environment:
- API_URL=http://api:8000
- WATCH_DIR=/videos
- SCANNER_API_KEY=${SCANNER_API_KEY}
- CONFIG_DIR=/app
matcher:
image: arthichaud/blee-matcher:edge
restart: on-failure
depends_on:
api:
condition: service_healthy
environment:
- RABBIT_HOST=mq
- RABBIT_PORT=5672
- API_URL=http://api:8000
- MATCHER_API_KEY=${MATCHER_API_KEY}
env_file:
- .env
db:
image: postgres:alpine3.16
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 3s
timeout: 5s
retries: 5
env_file:
- .env
expose:
- 5432
volumes:
- db:/var/lib/postgresql/data
nginx:
restart: on-failure
image: nginx:1.24.0-alpine
depends_on:
api:
condition: service_started
front:
condition: service_started
ports:
- ${PUBLIC_PORT}:5000
environment:
- PORT=5000
- FRONT_URL=http://front:3000
- SERVER_URL=http://api:8000
- TRANSCODER_URL=http://transcoder:7666
- SCANNER_URL=http://scanner:8133
volumes:
- ./nginx.conf.template:/etc/nginx/templates/blee.conf.template:ro
transcoder:
<<: *transcoder-base
profiles: ['', 'cpu']
transcoder-nvidia:
<<: *transcoder-base
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
environment:
- GOCODER_PREFIX=/video
- GOCODER_HWACCEL=nvidia
profiles: ['nvidia']
transcoder-vaapi:
<<: *transcoder-base
devices:
- /dev/dri:/dev/dri
environment:
- GOCODER_PREFIX=/video
- GOCODER_HWACCEL=vaapi
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
profiles: ['vaapi']
# qsv is the same setup as vaapi but with the hwaccel env var different
transcoder-qsv:
<<: *transcoder-base
devices:
- /dev/dri:/dev/dri
environment:
- GOCODER_PREFIX=/video
- GOCODER_HWACCEL=qsv
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
profiles: ['qsv']
volumes:
db:
data:
metadata: