-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (86 loc) · 2.92 KB
/
docker-compose.yml
File metadata and controls
91 lines (86 loc) · 2.92 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
services:
traefik:
image: traefik:v3.6
container_name: byteroute-traefik
restart: unless-stopped
command:
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=traefik
- --entrypoints.web.address=:80
- --entrypoints.web.forwardedHeaders.insecure=true
ports:
# Single public entrypoint for dashboard + API + Socket.IO
- "${TRAEFIK_PORT:-8080}:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- traefik
mongodb:
image: mongo:8
container_name: byteroute-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_DATABASE: byteroute
volumes:
- mongodb_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 }).ok"]
interval: 10s
timeout: 5s
retries: 10
networks:
- internal
backend:
image: ghcr.io/ste-script/byteroute-backend:latest
container_name: byteroute-backend
restart: unless-stopped
depends_on:
mongodb:
condition: service_healthy
environment:
NODE_ENV: production
PORT: "3000"
MONGODB_URI: mongodb://mongodb:27017/byteroute
# Required by the backend entrypoint (downloads GeoLite2 databases on start)
MAXMIND_USER_ID: ${MAXMIND_USER_ID:?set in .env}
MAXMIND_API_KEY: ${MAXMIND_API_KEY:?set in .env}
JWT_SECRET: ${JWT_SECRET:?set in .env}
# Optional: explicitly point to a custom domain DSL inside the container.
# Uncomment if you want to use a path other than /etc/byteroute/domain.dsl.yaml.
# DOMAIN_DSL_PATH: /etc/byteroute/domain.dsl.yaml
labels:
- traefik.enable=true
- traefik.docker.network=traefik
# Route REST API + Socket.IO to backend
- traefik.http.routers.byteroute-api.rule=PathPrefix(`/api`) || PathPrefix(`/socket.io`) || PathPrefix(`/auth`) || Path(`/health`)
- traefik.http.routers.byteroute-api.entrypoints=web
- traefik.http.routers.byteroute-api.priority=100
- traefik.http.routers.byteroute-api.service=byteroute-backend
- traefik.http.services.byteroute-backend.loadbalancer.server.port=3000
networks:
- internal
- traefik
dashboard:
image: ghcr.io/ste-script/byteroute-dashboard:latest
container_name: byteroute-dashboard
restart: unless-stopped
depends_on:
- backend
labels:
- traefik.enable=true
# Route everything else to the SPA
- traefik.http.routers.byteroute-ui.rule=PathPrefix(`/`)
- traefik.http.routers.byteroute-ui.entrypoints=web
- traefik.http.routers.byteroute-ui.priority=1
- traefik.http.routers.byteroute-ui.service=byteroute-dashboard
- traefik.http.services.byteroute-dashboard.loadbalancer.server.port=80
networks:
- traefik
volumes:
mongodb_data:
networks:
traefik:
name: traefik
internal:
name: byteroute_internal