Docker Composedocker-compose.yml
Production Next.js + Caddy Resource Guard (2GB VPS)
Template hemat RAM agar Node.js + reverse proxy HTTPS tidak pernah menembus batas memori 2 GB.
docker-compose.yml
services:
web:
build: .
restart: unless-stopped
mem_limit: 900m
environment:
- NODE_ENV=production
- NODE_OPTIONS=--max-old-space-size=512
- VAULT_DB_PATH=/app/data/vault.db
volumes:
- ./data:/app/data
caddy:
image: caddy:2-alpine
restart: unless-stopped
mem_limit: 128m
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data