-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (58 loc) · 2.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
62 lines (58 loc) · 2.19 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
services:
bot:
build:
context: .
dockerfile: Dockerfile
env_file: .env
restart: unless-stopped
environment:
# Unbuffered stdout/stderr so worker (child-process) log lines are
# captured by `docker compose logs` as they happen, not at worker exit.
PYTHONUNBUFFERED: "1"
volumes:
- ./wows-gamedata:/app/wows-gamedata:ro
- ./.git/modules/wows-gamedata:/app/.git/modules/wows-gamedata:ro
- gamedata-cache:/root/.cache/wows-gamedata
# Liveness — overrides the image HEALTHCHECK with the same semantics so
# the check is visible in compose config even when the image cache is
# primed separately.
healthcheck:
test:
- CMD
- python
- -c
- "import os,time,sys; sys.exit(0 if os.path.exists('/tmp/bot_heartbeat') and time.time()-os.path.getmtime('/tmp/bot_heartbeat')<120 else 1)"
interval: 60s
timeout: 5s
start_period: 60s
retries: 3
# Resource limits — cairo renders can spike RAM on high-res output, and
# larger/longer replays (e.g. Chapaev matches) were hitting the original
# 2G cap and triggering the cgroup OOM killer. VPS has 7.5G total with
# ~1G used by other containers, so 4.5G (4608M — docker-compose memory
# values must be integers) gives generous headroom for two concurrent
# renders plus the idle bot (~1.2G).
# `deploy.resources` works in Compose v2.20+ (non-swarm); mem_limit/cpus
# are the legacy equivalents kept for broader compatibility.
# The bot is the sole tenant on this VPS, so the CPU cap is set to the
# full 4 vCPUs. With MAX_WORKERS=2, a single render can use all 4 cores
# via libx264 auto-threading; concurrent renders timeshare via the OS
# scheduler. Memory cap stays at 4.5G to leave the host OS comfortable.
deploy:
resources:
limits:
memory: 4608M
cpus: "4.0"
reservations:
memory: 1G
mem_limit: 4608m
cpus: 4.0
# Rolling logs: ~50 MB ceiling (10 MB × 5 files). Prevents disk fill from
# render-heavy days.
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
volumes:
gamedata-cache: