-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
163 lines (159 loc) · 3.66 KB
/
docker-compose.dev.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
x-transcoder: &transcoder-base
image: ghcr.io/zoriya/kyoo_transcoder:edge
networks:
default:
aliases:
- transcoder
ports:
- "7666:7666"
restart: on-failure
cpus: 1
env_file:
- ./.env
environment:
- GOCODER_PREFIX=/videos
volumes:
- ${DATA_DIR}:/videos:ro
- ${CACHE_ROOT}:/cache
- metadata:/metadata
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_SCHEMA=gocoder
- POSTGRES_SERVER=db
services:
scanner:
build:
context: ./scanner
dockerfile: Dockerfile.dev
restart: on-failure
ports:
- "8133:8133"
depends_on:
api:
condition: service_healthy
volumes:
- ./scanner:/app
- ./scanner.example.json:/config/scanner.json
- ${DATA_DIR}:/videos
environment:
- API_URL=http://api:8000
- WATCH_DIR=/videos
- SCANNER_API_KEY=${SCANNER_API_KEY}
- CONFIG_DIR=/config
api:
build:
context: ./api
dockerfile: Dockerfile.dev
ports:
- "8000:8000"
restart: on-failure
depends_on:
db:
condition: service_healthy
mq:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:8000/ || exit 1
interval: 10s
retries: 10
environment:
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- CONFIG_DIR=/data
- RABBIT_HOST=mq
- RABBIT_PORT=5672
env_file:
- .env
volumes:
- ./api:/app
- api_images:/data
- api_target:/app/target
- api_cargo:/usr/local/cargo
mq:
image: rabbitmq:3.13-alpine
environment:
- RABBITMQ_DEFAULT_USER=${RABBIT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBIT_PASS}
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 5s
timeout: 5s
retries: 10
front:
ports:
- "3000:3000"
build:
context: ./front
dockerfile: Dockerfile.dev
environment:
- SSR_SERVER_URL=http://api:8000
- SSR_TRANSCODER_URL=http://transcoder:7666
- SSR_SCANNER_URL=http://scanner:8133
volumes:
- ./front:/app
matcher:
build:
context: ./matcher
dockerfile: Dockerfile.dev
restart: on-failure
depends_on:
api:
condition: service_healthy
volumes:
- ./matcher:/app
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: 5s
timeout: 5s
retries: 10
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']
volumes:
db:
api_target:
api_images:
api_cargo:
metadata: