-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (65 loc) · 2.11 KB
/
docker-compose.yml
File metadata and controls
69 lines (65 loc) · 2.11 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
services:
# ── Django backend ──────────────────────────────────────────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
environment:
- DEBUG=0
- SECRET_KEY=${SECRET_KEY:-change-me-in-production}
- DATABASE_URL=${DATABASE_URL:-sqlite:///db/sonata.db}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}
- SCANNER_URL=http://scanner:4040
- SCANNER_SECRET=${SCANNER_SECRET:-scanner-secret-change-me}
- CORS_ALLOWED_ORIGINS=http://localhost:3000
volumes:
- music_data:/music
- db_data:/app/db
- media_data:/app/media
ports:
- "8000:8000"
depends_on:
- scanner
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8000/rest/ping?u=x&p=x&v=1.16.1&c=health&f=json"]
interval: 30s
timeout: 10s
retries: 3
# ── Go scanner service ──────────────────────────────────────────────────────
scanner:
build:
context: ./scanner
dockerfile: Dockerfile
environment:
- DJANGO_URL=http://backend:8000
- SCANNER_SECRET=${SCANNER_SECRET:-scanner-secret-change-me}
- SCANNER_PORT=4040
volumes:
- music_data:/music:ro
ports:
- "4040:4040"
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:4040/health"]
interval: 30s
timeout: 5s
retries: 3
# ── Nginx reverse proxy & frontend hosting ──────────────────────────────────
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./frontend/dist:/usr/share/nginx/html/app:ro
depends_on:
- backend
restart: unless-stopped
volumes:
music_data:
driver: local
db_data:
driver: local
media_data:
driver: local