-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
172 lines (160 loc) · 5.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
172 lines (160 loc) · 5.54 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
# MediathekNext — Docker Compose
#
# Three deployment patterns:
#
# 1. Standalone (default, single-machine):
# docker compose up standalone
#
# 2. Scaled-out (core + N workers):
# docker compose up core worker
# docker compose up core --scale worker=3
#
# 3. Full stack with observability:
# docker compose --profile observability up core worker
version: "3.9"
x-worker-base: &worker-base
build:
context: .
dockerfile: docker/worker/Dockerfile
restart: unless-stopped
networks:
- mediathek
# ──────────────────────────────────────────────────────────────
# Standalone — everything in one container
# ──────────────────────────────────────────────────────────────
services:
standalone:
<<: *worker-base
environment:
MEDIATHEK_ROLE: standalone
Database__Provider: sqlite
Database__ConnectionString: "Data Source=/data/mediathek.db"
TickerQ__Dashboard__Username: admin
TickerQ__Dashboard__Password: changeme # CHANGE THIS before exposing externally
volumes:
- sqlite-data:/data
- downloads:/downloads
ports:
- "8080:8080"
profiles:
- standalone
# ──────────────────────────────────────────────────────────────
# Core — DB owner + catalog refresh + API
# ──────────────────────────────────────────────────────────────
core:
<<: *worker-base
environment:
MEDIATHEK_ROLE: core
Database__Provider: sqlite
Database__ConnectionString: "Data Source=/data/mediathek.db"
TickerQ__Dashboard__Username: admin
TickerQ__Dashboard__Password: changeme # CHANGE THIS before exposing externally
volumes:
- sqlite-data:/data
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- distributed
# ──────────────────────────────────────────────────────────────
# Worker — download executor, scalable
# docker compose up --scale worker=3
# ──────────────────────────────────────────────────────────────
worker:
<<: *worker-base
environment:
MEDIATHEK_ROLE: worker
Database__Provider: sqlite
Database__ConnectionString: "Data Source=/data/mediathek.db"
Downloads__MaxConcurrent: 2
volumes:
- sqlite-data:/data # read/write DownloadJobs only
- downloads:/downloads
depends_on:
core:
condition: service_healthy
profiles:
- distributed
# ──────────────────────────────────────────────────────────────
# Web frontend — Blazor Server
# ──────────────────────────────────────────────────────────────
frontend:
build:
context: .
dockerfile: docker/frontend/Dockerfile
restart: unless-stopped
environment:
ApiBaseUrl: "http://core:8080"
ports:
- "80:8080"
depends_on:
core:
condition: service_healthy
networks:
- mediathek
profiles:
- distributed
frontend-standalone:
build:
context: .
dockerfile: docker/frontend/Dockerfile
restart: unless-stopped
environment:
ApiBaseUrl: "http://standalone:8080"
ports:
- "80:8080"
depends_on:
- standalone
networks:
- mediathek
profiles:
- standalone
# ──────────────────────────────────────────────────────────────
# Observability stack (opt-in: --profile observability)
# ──────────────────────────────────────────────────────────────
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- mediathek
profiles:
- observability
loki:
image: grafana/loki:latest
restart: unless-stopped
volumes:
- loki-data:/loki
networks:
- mediathek
profiles:
- observability
grafana:
image: grafana/grafana:latest
restart: unless-stopped
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
volumes:
- grafana-data:/var/lib/grafana
- ./docker/grafana/provisioning:/etc/grafana/provisioning:ro
ports:
- "3000:3000"
networks:
- mediathek
profiles:
- observability
volumes:
sqlite-data:
downloads:
prometheus-data:
loki-data:
grafana-data:
networks:
mediathek:
driver: bridge