Files

49 lines
1.9 KiB
YAML
Raw Permalink Normal View History

# Optional Compose file for Dokploy's "Compose" deployment type.
#
# The RECOMMENDED path is a Dokploy "Application" pointed at this repo with build type = Dockerfile
# (Dokploy then manages Traefik routing, the domain, TLS, and env injection for you). This file is
# provided for teams who prefer a Compose deployment.
#
# Runtime env vars (DATABASE_URL, SESSION_SECRET, SPACES_*, etc.) come from Dokploy's Environment
# settings — do NOT hardcode them here. VITE_* values are build-time only (see build.args below).
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
# Build-time public config inlined into the browser bundle by Vite.
VITE_TURNSTILE_SITE_KEY: ${VITE_TURNSTILE_SITE_KEY:-}
VITE_SENTRY_DSN: ${VITE_SENTRY_DSN:-}
restart: unless-stopped
# Resource guardrails so a memory leak or an upload/AI spike can't OOM the whole
# Dokploy host (a shared Swarm node). Dokploy applies Compose via Swarm-style deploy,
# so the limits/reservations below are the effective form. Tune the values as needed.
deploy:
resources:
limits:
cpus: "1.0"
memory: 1g
reservations:
memory: 512m
environment:
NODE_ENV: production
PORT: 8080
# All other runtime variables are injected by Dokploy (Environment settings). Keep the full
# list from .env.example in sync there: PUBLIC_URL, COOKIE_DOMAIN, SESSION_SECRET, CSRF_SECRET,
# SUPERADMIN_EMAILS, DATABASE_URL, DATABASE_CA_CERT_PATH, SPACES_*, SMTP2GO_API_KEY, EMAIL_FROM,
# ANTHROPIC_API_KEY, TURNSTILE_SECRET_KEY, STRIPE_*, SENTRY_DSN_API.
expose:
- "8080"
healthcheck:
test:
- CMD
- node
- -e
- "fetch('http://127.0.0.1:8080/api/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
interval: 30s
timeout: 5s
retries: 3
start_period: 25s