110 lines
3.5 KiB
YAML
110 lines
3.5 KiB
YAML
services:
|
|
cms:
|
|
image: epicnext-cms:${CMS_RELEASE:-local}
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
NEXT_DEPLOYMENT_ID: ${CMS_RELEASE:-unknown}
|
|
network: host
|
|
container_name: epicnext-cms
|
|
stop_grace_period: 10s
|
|
network_mode: host
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- HOSTNAME=0.0.0.0
|
|
volumes:
|
|
- ./public/nitro-assets:/app/public/nitro-assets
|
|
- ./public/swf:/app/public/swf
|
|
- ./storage:/app/storage
|
|
- /var/www/Gamedata:/var/www/Gamedata
|
|
|
|
# ── Resource limits aangepast voor 24 GB RAM ──
|
|
# Verwijderd: mem_limit, memswap_limit en cpus. Next.js mag onbeperkt presteren.
|
|
pids_limit: 1024 # Verhoogd van 512 zodat Node.js/Next.js oneindig veel async requests aankan
|
|
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://localhost:3002/api/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
# ── Byparr (Cloudflare bypass for clone sources) ──
|
|
byparr:
|
|
image: ghcr.io/thephaseless/byparr:latest
|
|
container_name: byparr
|
|
network_mode: host
|
|
restart: unless-stopped
|
|
environment:
|
|
- LOG_LEVEL=INFO
|
|
|
|
# Resource limits verwijderd: Headless Chrome heeft bij zware pagina-scrapes
|
|
# soms tijdelijk meer dan 1 GB RAM nodig. Nu krijgt hij alle ruimte.
|
|
pids_limit: 256
|
|
|
|
healthcheck:
|
|
test: ["CMD", "curl", "http://localhost:8191/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
# ── MariaDB "Turbo" (heavy JSON / bulk-loads) ──
|
|
mariadb-turbo:
|
|
image: mariadb:11
|
|
container_name: mariadb-turbo
|
|
profiles: ["db"]
|
|
network_mode: host
|
|
restart: unless-stopped
|
|
environment:
|
|
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-root}
|
|
- MARIADB_DATABASE=${MARIADB_DATABASE:-habbo}
|
|
- MARIADB_USER=${MARIADB_USER:-cms}
|
|
- MARIADB_PASSWORD=${MARIADB_PASSWORD:-cms}
|
|
- MARIADB_AUTO_UPGRADE=1
|
|
command: [
|
|
"--character-set-server=utf8mb4",
|
|
"--collation-server=utf8mb4_unicode_ci",
|
|
"--max-allowed-packet=512M",
|
|
"--net-buffer-length=1M",
|
|
"--connect-timeout=30",
|
|
"--wait-timeout=3600",
|
|
"--interactive-timeout=3600",
|
|
"--net-read-timeout=600",
|
|
"--net-write-timeout=600",
|
|
"--innodb-flush-log-at-trx-commit=2",
|
|
"--innodb-buffer-pool-size=2G", # Perfect ingesteld voor een 24 GB server!
|
|
"--innodb-buffer-pool-instances=4",
|
|
"--innodb-log-file-size=1G",
|
|
"--innodb-log-buffer-size=64M",
|
|
"--innodb-flush-method=O_DIRECT",
|
|
"--innodb-autoextend-increment=512",
|
|
"--innodb-max-dirty-pages-pct=90",
|
|
"--bulk-insert-buffer-size=512M",
|
|
"--innodb-doublewrite=0",
|
|
"--innodb-use-native-aio=0",
|
|
"--tmp-table-size=256M",
|
|
"--max-heap-table-size=256M",
|
|
"--read-buffer-size=4M",
|
|
"--read-rnd-buffer-size=16M",
|
|
"--performance-schema=OFF",
|
|
"--skip-name-resolve",
|
|
]
|
|
volumes:
|
|
- mariadb-turbo-data:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "healthcheck.sh --connect --innodb_initialized || mariadb-admin ping --silent"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
# Geoptimaliseerd: We verhogen de limiet naar 6 GB of halen hem volledig weg,
|
|
# zodat de InnoDB buffer pool en zware JSON imports nooit Out Of Memory gaan.
|
|
|
|
volumes:
|
|
mariadb-turbo-data:
|
|
driver: local |