forked from Thiritin/streaming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
237 lines (231 loc) · 7.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
237 lines (231 loc) · 7.22 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
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
services:
laravel.test:
build:
context: ./docker/8.4
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.4/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
# SUPERVISOR_PHP_COMMAND: "/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80"
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
- redis
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- 'sail-mysql:/var/lib/mysql'
- './docker/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
networks:
- sail
healthcheck:
test:
- CMD
- mysqladmin
- ping
- '-p${DB_PASSWORD}'
retries: 3
timeout: 5s
redis:
image: 'redis:alpine'
ports:
- '${FORWARD_REDIS_PORT:-6379}:6379'
volumes:
- 'sail-redis:/data'
networks:
- sail
healthcheck:
test:
- CMD
- redis-cli
- ping
retries: 3
timeout: 5s
# ORIGIN SERVICES
origin-srs:
image: ossrs/srs:6
ports:
- '${FORWARD_SRS_RTMP_PORT:-1935}:1935'
- '${FORWARD_SRS_HTTP_PORT:-8082}:8082'
- '${FORWARD_SRS_API_PORT:-1985}:1985'
environment:
SRS_HTTP_PORT: 8082
networks:
- sail
volumes:
- ./docker/origin-srs/origin.conf:/usr/local/srs/conf/custom.conf:ro
- dvr-recordings:/dvr/recordings
command: ./objs/srs -c /usr/local/srs/conf/custom.conf
depends_on:
- laravel.test
restart: unless-stopped
# Origin FFmpeg HLS Transcoder - Creates multi-bitrate HLS from SRS
# origin-ffmpeg-hls:
# image: eurofurence/ffmpeg-hls:latest
# environment:
# SRS_API_URL: http://localhost:1985/api/v1
# SRS_RTMP_URL: rtmp://localhost:1935
# OUTPUT_BASE_DIR: /var/www/hls/live
# CHECK_INTERVAL: 5
# volumes:
# # HLS output directory shared with origin-nginx
# - hls-content:/var/www/hls
# network_mode: host
# restart: unless-stopped
# depends_on:
# - origin-srs
# Origin Nginx - Serves HLS with auth_request authentication
origin-nginx:
image: nginx:alpine
ports:
- '${FORWARD_ORIGIN_NGINX_PORT:-8083}:8083'
volumes:
- ./docker/origin-nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- hls-content:/var/www/hls:ro
- origin-nginx-logs:/var/log/nginx
networks:
- sail
depends_on:
- laravel.test
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8083/health"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
# Origin Caddy - SSL termination for origin (port 8070 for local, 8080 in production)
origin-caddy:
image: caddy:alpine
ports:
- '${FORWARD_ORIGIN_CADDY_PORT:-8070}:8070'
environment:
DOMAIN: '${APP_URL:-localhost}'
CADDY_PORT: 8070
NGINX_ORIGIN_PORT: 8083
volumes:
- ./docker/origin-caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- origin-caddy-data:/data
- origin-caddy-config:/config
- origin-caddy-logs:/var/log/caddy
networks:
- sail
depends_on:
- origin-nginx
restart: unless-stopped
# DVR S3 Uploader Service
dvr-uploader:
image: eurofurence/dvr-uploader:latest
environment:
S3_BUCKET: '${DVR_AWS_BUCKET:-ef-streaming-recordings}'
S3_REGION: '${DVRnp_AWS_DEFAULT_REGION:-eu-central-1}'
S3_ACCESS_KEY: '${DVR_AWS_ACCESS_KEY_ID}'
S3_SECRET_KEY: '${DVR_AWS_SECRET_ACCESS_KEY}'
S3_ENDPOINT: '${DVR_AWS_ENDPOINT}'
RECORDINGS_PATH: /dvr/recordings
DELETE_AFTER_UPLOAD: 'true'
WEBHOOK_URL: 'http://laravel.test/api/dvr/upload-webhook'
FILE_AGE_SECONDS: '30'
UPLOAD_DELAY_SECONDS: '5'
MAX_UPLOAD_RATE_MBPS: '3'
volumes:
- dvr-recordings:/dvr/recordings
networks:
- sail
depends_on:
- origin-srs
- laravel.test
restart: unless-stopped
# EDGE SERVICES
# Edge Nginx - Proxies and caches content from origin Caddy
edge-nginx:
image: nginx:alpine
ports:
- '${FORWARD_EDGE_NGINX_PORT:-8081}:8081'
volumes:
- ./docker/edge-nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- edge-nginx-logs:/var/log/nginx
- edge-nginx-cache:/var/cache/nginx
networks:
- sail
depends_on:
- laravel.test
- origin-caddy
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8081/health"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
# Edge Caddy - SSL termination for edge server
edge-caddy:
image: caddy:alpine
ports:
- '${FORWARD_EDGE_CADDY_PORT:-8080}:8080'
environment:
DOMAIN: '${APP_URL:-localhost}'
CADDY_PORT: 8080
NGINX_EDGE_PORT: 8081
volumes:
- ./docker/edge-caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- caddy-data:/data
- caddy-config:/config
- caddy-logs:/var/log/caddy
networks:
- sail
restart: unless-stopped
volumes:
sail-mysql:
driver: local
sail-redis:
driver: local
# Origin volumes
hls-content:
driver: local
origin-nginx-logs:
driver: local
origin-caddy-data:
driver: local
origin-caddy-config:
driver: local
origin-caddy-logs:
driver: local
# DVR volumes
dvr-recordings:
driver: local
# Edge volumes
edge-nginx-logs:
driver: local
edge-nginx-cache:
driver: local
caddy-data:
driver: local
caddy-config:
driver: local
caddy-logs:
driver: local
networks:
sail:
driver: bridge