-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
74 lines (68 loc) · 2.8 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
74 lines (68 loc) · 2.8 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
# ============================================
# Streamify — Docker Compose (Production + Traefik)
# ============================================
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
# OR: make prod
# ============================================
services:
# ---- Traefik (Edge Reverse Proxy) ----
traefik:
image: traefik:v3.3
container_name: streamify-traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./infra/traefik/traefik.yml:/etc/traefik/traefik.yml:ro
- ./infra/traefik/dynamic.yml:/etc/traefik/dynamic.yml:ro
- traefik_certs:/letsencrypt
environment:
- TRAEFIK_CERTIFICATESRESOLVERS_letsencrypt_ACME_EMAIL=${ACME_EMAIL:-admin@example.com}
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
networks:
- streamify
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.${DOMAIN:-localhost}`)"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.entrypoints=traefik"
- "traefik.http.routers.dashboard.middlewares=dashboard-auth"
- "traefik.http.middlewares.dashboard-auth.basicauth.users=${TRAEFIK_DASHBOARD_AUTH:-admin:$$apr1$$xyz$$placeholder}"
# ---- Frontend — Traefik labels ----
frontend:
ports: []
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`${DOMAIN:-localhost}`)"
- "traefik.http.routers.frontend.entrypoints=websecure"
- "traefik.http.routers.frontend.tls=true"
- "traefik.http.routers.frontend.tls.certresolver=letsencrypt"
- "traefik.http.routers.frontend.middlewares=security-chain@file"
- "traefik.http.routers.frontend-http.rule=Host(`${DOMAIN:-localhost}`)"
- "traefik.http.routers.frontend-http.entrypoints=web"
- "traefik.http.routers.frontend-http.middlewares=https-redirect@file"
- "traefik.http.services.frontend.loadbalancer.server.port=80"
# ---- Backend — No external ports in production ----
backend:
ports: []
environment:
- CORS_ORIGIN=https://${DOMAIN:-localhost}
# ---- MongoDB — No external ports in production ----
mongo:
ports: []
# ---- Redis — No external ports in production ----
redis:
ports: []
# ---- Additional Volumes ----
volumes:
traefik_certs:
driver: local