-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
docker-compose.build.yml
208 lines (193 loc) · 4.73 KB
/
docker-compose.build.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
x-transcoder: &transcoder-base
build: ./transcoder
networks:
default:
aliases:
- transcoder
restart: on-failure
env_file:
- ./.env
environment:
- GOCODER_PREFIX=/video
volumes:
- ${LIBRARY_ROOT}:/video:ro
- ${CACHE_ROOT}:/cache
- metadata:/metadata
services:
back:
build: ./back
restart: on-failure
environment:
- TRANSCODER_URL=${TRANSCODER_URL:-http://transcoder:7666}
env_file:
- ./.env
depends_on:
postgres:
condition: service_healthy
meilisearch:
condition: service_healthy
rabbitmq:
condition: service_healthy
migrations:
condition: service_completed_successfully
volumes:
- kyoo:/metadata
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=PathPrefix(`/api/`)"
- "traefik.http.routers.api.middlewares=api-sp"
- "traefik.http.middlewares.api-sp.stripprefix.prefixes=/api"
- "traefik.http.middlewares.api-sp.stripprefix.forceSlash=false"
migrations:
build:
context: ./back
dockerfile: Dockerfile.migrations
restart: "no"
depends_on:
postgres:
condition: service_healthy
env_file:
- ./.env
front:
build: ./front
restart: on-failure
environment:
- KYOO_URL=${KYOO_URL:-http://back:5000}
labels:
- "traefik.enable=true"
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
auth:
build: ./auth
restart: on-failure
depends_on:
postgres:
condition: service_healthy
env_file:
- ./.env
labels:
- "traefik.enable=true"
- "traefik.http.routers.auth.rule=PathPrefix(`/auth/`)"
- "traefik.http.routers.auth.middlewares=auth-sp"
- "traefik.http.middlewares.auth-sp.stripprefix.prefixes=/auth"
- "traefik.http.middlewares.auth-sp.stripprefix.forceSlash=false"
profiles:
- "v5"
scanner:
build: ./scanner
restart: on-failure
depends_on:
back:
condition: service_healthy
env_file:
- ./.env
environment:
- KYOO_URL=${KYOO_URL:-http://back:5000}
volumes:
- ${LIBRARY_ROOT}:/video:ro
matcher:
build: ./scanner
command: matcher
restart: on-failure
depends_on:
back:
condition: service_healthy
env_file:
- ./.env
environment:
- KYOO_URL=${KYOO_URL:-http://back:5000}
autosync:
build: ./autosync
restart: on-failure
depends_on:
rabbitmq:
condition: service_healthy
env_file:
- ./.env
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']
traefik:
image: traefik:v3.2
restart: on-failure
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.web.address=:8901"
- "--accesslog=true"
ports:
- "8901:8901"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
postgres:
image: postgres:15
restart: on-failure
env_file:
- ./.env
volumes:
- db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
meilisearch:
image: getmeili/meilisearch:v1.4
restart: on-failure
volumes:
- search:/meili_data
environment:
- MEILI_ENV=production
env_file:
- .env
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--spider", "http://meilisearch:7700/health"]
interval: 30s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:4-alpine
restart: on-failure
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 10s
retries: 5
start_period: 10s
volumes:
kyoo:
db:
metadata:
search: