2026-08-19 21:54:54 +07:00
|
|
|
[Unit]
|
|
|
|
|
Description=MCPedia API (tRPC/Hono + git-sync webhooks)
|
|
|
|
|
After=network-online.target
|
|
|
|
|
Wants=network-online.target
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=simple
|
|
|
|
|
WorkingDirectory=/home/code/mcpedia
|
|
|
|
|
# Loads DATABASE_URL, REDIS_*, EMBED_*, WEBHOOK_SECRET from the repo .env
|
|
|
|
|
# (.env is gitignored; for prod, point this at a deployed secret file).
|
|
|
|
|
EnvironmentFile=/home/code/mcpedia/.env
|
2026-08-20 09:38:32 +07:00
|
|
|
# Absolute bun path (systemd has a minimal PATH; /usr/bin/env bun fails).
|
|
|
|
|
ExecStart=/home/code/.bun/bin/bun --cwd apps/api src/index.ts
|
2026-08-19 21:54:54 +07:00
|
|
|
Restart=on-failure
|
|
|
|
|
RestartSec=5
|
|
|
|
|
User=code
|
|
|
|
|
Group=code
|
|
|
|
|
# The API needs WEBHOOK_SECRET; fail-fast is built into the app if it's missing.
|
|
|
|
|
NoNewPrivileges=true
|
|
|
|
|
PrivateTmp=true
|
|
|
|
|
MemoryMax=512M
|
|
|
|
|
TasksMax=256
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|