-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (54 loc) · 2.12 KB
/
Copy pathdocker-compose.yml
File metadata and controls
63 lines (54 loc) · 2.12 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
services:
animind-backend:
build:
context: .
dockerfile: Dockerfile
# Pass build-time args if you ever need them (e.g. build metadata)
args:
NODE_ENV: production
container_name: animind-backend
restart: unless-stopped
ports:
- "3001:3001"
env_file:
- .env
# ── Socket.IO / WebSocket tuning ─────────────────────────────────────────
# Node default is 1024 open files; WebSocket rooms with many peers need more.
ulimits:
nofile:
soft: 65536
hard: 65536
# ── Resource limits ──────────────────────────────────────────────────────
# 2 core / 1GB RAM VPS — leave ~200MB headroom for the OS and Nginx.
deploy:
resources:
limits:
memory: 700M
cpus: '1.5'
reservations:
memory: 256M
cpus: '0.5'
# ── Health check (uses curl installed in Dockerfile) ─────────────────────
# Matches the HEALTHCHECK directive in the Dockerfile; compose overrides
# it here so you can tune intervals without rebuilding the image.
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:3001/health"]
interval: 30s
timeout: 5s
retries: 5
start_period: 20s
# ── Logging ──────────────────────────────────────────────────────────────
# Rotate logs so the VPS disk doesn't fill up over time.
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
# ── Local storage volume ─────────────────────────────────────────────────
volumes:
- /mnt/anime:/mnt/anime
networks:
- npm-network
networks:
npm-network:
external: true