-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
173 lines (162 loc) · 5.33 KB
/
docker-compose.yaml
File metadata and controls
173 lines (162 loc) · 5.33 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
name: quakejs
# Define the custom network for all services
networks:
quakejs:
name: quakejs
services:
# Reverse Proxy and Load Balancer
traefik:
image: "traefik:v3.3.3"
container_name: "traefik"
restart: unless-stopped
mem_limit: 512m # Limit memory usage to 512MB
cpus: 0.5 # Limit CPU usage to 50% of a single core
networks:
- quakejs
ports:
- target: 80
published: 80
mode: host
- target: 27960
published: 27960
mode: host
volumes:
- "./data/dynamic:/etc/traefik/dynamic" # Directory for dynamic configuration
- "./data/logs:/logs" # Directory for logs
- "/var/run/docker.sock:/var/run/docker.sock:ro" # Allow Traefik to access Docker
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
command:
# General settings
- "--global.sendAnonymousUsage=false"
- "--log.level=INFO"
- "--accesslog=true"
- "--accesslog.filepath=/logs/access.log"
- "--accesslog.format=common"
- "--accesslog.fields.defaultmode=keep"
- "--accesslog.fields.headers.defaultmode=keep"
# API and Dashboard
- "--api=true"
- "--api.dashboard=true"
# Docker Provider Configuration
- "--providers.docker=true"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik"
# File Provider Configuration
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.watch=true"
# Entry points
- "--entrypoints.web.address=:80"
- "--entrypoints.quakejs.address=:27960/tcp"
- "--entryPoints.web.forwardedHeaders.trustedIPs=127.0.0.1"
# Metrics
- "--metrics.prometheus=true"
- "--metrics.prometheus.addEntryPointsLabels=true"
- "--entryPoints.metrics.address=:8082"
- "--metrics.prometheus.entryPoint=metrics"
labels:
- "traefik.enable=true"
# Traefik Dashboard
- "traefik.http.routers.dashboard-web.rule=Host(`traefik-dashboard.example.com`)"
- "traefik.http.routers.dashboard-web.entrypoints=web"
- "traefik.http.routers.dashboard-web.service=api@internal"
- "traefik.http.services.dashboard-web.loadbalancer.server.port=80"
- "traefik.http.services.dashboard-web.loadbalancer.server.scheme=http"
# QuakeJS Server
quakejs:
image: ghcr.io/wwwlde/quakejs-docker:v0.0.1
container_name: "quakejs"
restart: unless-stopped
networks:
- quakejs
expose:
- 80
- 27960/tcp
volumes:
- "./data/server.cfg:/quakejs/base/baseq3/server.cfg" # QuakeJS server configuration
environment:
- HTTP_PORT=80
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
labels:
- "traefik.enable=true"
# QuakeJS WebSocket
- "traefik.tcp.routers.quakejs.rule=HostSNI(`*`)"
- "traefik.tcp.routers.quakejs.entrypoints=quakejs"
- "traefik.tcp.routers.quakejs.service=quakejs"
- "traefik.tcp.services.quakejs.loadbalancer.server.port=27960"
# QuakeJS HTTP Access
- "traefik.http.routers.quakejs.rule=Host(`quakejs.example.com`)"
- "traefik.http.routers.quakejs.entrypoints=web"
- "traefik.http.routers.quakejs.service=quakejs"
- "traefik.http.services.quakejs.loadbalancer.server.port=80"
- "traefik.http.services.quakejs.loadbalancer.server.scheme=http"
# Proxy for QuakeJS to handle UDP <-> WS conversion
quakejs-proxy:
image: ghcr.io/wwwlde/quakejs-proxy:v0.0.1
container_name: "quakejs-proxy"
restart: unless-stopped
networks:
- quakejs
expose:
- 27960/udp
command:
- "-wquakejs:27960"
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
depends_on:
- quakejs
labels:
- "traefik.enable=true"
# QuakeJS UDP Proxy
- "traefik.udp.routers.quakejs-proxy.rule=HostSNI(`*`)"
- "traefik.udp.routers.quakejs-proxy.entrypoints=quakejs"
- "traefik.udp.routers.quakejs-proxy.service=quakejs-proxy"
- "traefik.udp.services.quakejs-proxy.loadbalancer.server.port=27960"
# QuakeJS Stats Tracker
quakejs-stats:
image: quakejs-stats:local
container_name: "quakejs-stats"
restart: unless-stopped
build:
context: build
dockerfile: Dockerfile
networks:
- quakejs
expose:
- 5000
volumes:
- "./data/db:/app/db" # Database storage for tracking statistics
environment:
- SERVER_IP=quakejs-proxy
- SERVER_PORT=27960
- RCON_PASSWORD=5tr0nG_P@ssw0rd!
- TRACKED_PLAYERS=Visor,Sarge,Major
- MATCH_TIMEOUT=3600
- DB_PATH=/app/db/quake_stats.db
- RUNNING=True
logging:
driver: "json-file"
options:
max-file: 5
max-size: 10m
depends_on:
- quakejs-proxy
labels:
- "traefik.enable=true"
# QuakeJS Stats Web UI
- "traefik.http.routers.quakejs-stats.rule=Host(`quakejs-stats.example.com`)"
- "traefik.http.routers.quakejs-stats.entrypoints=web"
- "traefik.http.routers.quakejs-stats.service=quakejs-stats"
- "traefik.http.services.quakejs-stats.loadbalancer.server.port=5000"
- "traefik.http.services.quakejs-stats.loadbalancer.server.scheme=http"