[Unit] Description=Cresc API After=network-online.target Wants=network-online.target PartOf=cresc.target [Service] Type=simple User=root WorkingDirectory=/root Environment=NODE_ENV=production Environment=API_SLOT=primary Environment=API_CANDIDATE_UNIT=cresc-api-candidate.service Environment=API_LEGACY_PEER_UNIT=cresc-api-peer.service Environment=API_LEGACY_PEER_MIGRATION_MARKER=/run/cresc-rollout/legacy-peer Environment=API_WORKER_UNIT=cresc-worker.service Environment=API_5XX_EVENT_JOURNAL_UNIT=cresc-api.service Environment=DIAGNOSTIC_SOCKET_PATH=/run/cresc/metrics.sock ExecStart=/opt/cresc/runtime/bun --env-file=/root/.env.prod /opt/cresc/current/lib/index.js Restart=always RestartSec=3 TimeoutStopSec=30 KillMode=control-group OOMPolicy=stop OOMScoreAdjust=-500 RuntimeDirectory=cresc RuntimeDirectoryMode=0750 # Safe fallback for first boot. configure-host-memory.sh installs a host-sized # systemd drop-in that overrides these values before activation. MemoryHigh=512M MemoryMax=768M MemorySwapMax=384M LimitNOFILE=65536 SyslogIdentifier=cresc-api [Install] WantedBy=cresc.target