Repository navigation
Expand file tree
/
Copy pathdocker-compose.vps.yml
More file actions
69 lines (67 loc) · 2.51 KB
/
Copy pathdocker-compose.vps.yml
File metadata and controls
69 lines (67 loc) · 2.51 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
# SPDX-FileCopyrightText: 2025 Juan Manuel Méndez Rey
# SPDX-License-Identifier: GPL-3.0-or-later
# VPS-specific Docker Compose configuration
# This runs only the Conquer game container, using host Apache as reverse proxy
services:
conquer:
build:
context: ./conquer
args:
# uid of the unprivileged game user; match the host user that owns
# data/ so the backup scripts can read it without sudo
CONQUER_UID: ${CONQUER_UID:-1000}
container_name: conquer-vps
environment:
- MAX_CLIENTS=${MAX_CLIENTS:-5}
- SESSION_TIMEOUT=${SESSION_TIMEOUT:-1800}
- TTYD_FONT_SIZE=${TTYD_FONT_SIZE:-16}
- TZ=${TZ:-UTC}
- TURN_SCHEDULE=${TURN_SCHEDULE:-0 20 * * 0}
- TURN_SCHEDULE_LABEL=${TURN_SCHEDULE_LABEL:-}
- TURN_RETRY_MINUTES=${TURN_RETRY_MINUTES:-10}
- TURN_MAX_RETRIES=${TURN_MAX_RETRIES:-18}
- TURN_GRACE_MINUTES=${TURN_GRACE_MINUTES:-5}
- TURN_BACKUPS=${TURN_BACKUPS:-10}
- TURN_WEBHOOK_URL=${TURN_WEBHOOK_URL:-}
- TURN_EARLY=${TURN_EARLY:-on}
- SIGNUP=${SIGNUP:-on}
- ADMIN_CONTACT=${ADMIN_CONTACT:-}
volumes:
# Live world data: persists across rebuilds, seeded on first start
- ./data/lib:/opt/conquer/lib
# Automatic world backups taken before every turn update
- ./data/backups:/opt/conquer/backups
# Players' private practice worlds
- ./data/practice:/opt/conquer/practice
# Player accounts (the file host Apache checks), written when players
# join with an invite code
- ${HTPASSWD_FILE:-/etc/apache2/conquer-web.htpasswd}:/opt/conquer/auth/htpasswd
# Public game status (status.json) served by Apache under /status/
- ${STATUS_DIR:-./data/public}:/opt/conquer/public
# Least privilege: the entrypoint runs as root only to fix the volumes'
# owners, set up cron and drop to the game user (setpriv); the game,
# ttyd and the sign-up service never hold these capabilities
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- FOWNER
- SETUID
- SETGID
- KILL
- AUDIT_WRITE
security_opt:
- no-new-privileges:true
# A runaway game or a flood of sessions cannot take the whole server
pids_limit: 512
mem_limit: 1g
restart: unless-stopped
ports:
- "127.0.0.1:7681:7681" # Only bind to localhost for security
- "127.0.0.1:7682:7682" # Sign-up service, for Apache only
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"