Deploy Server
app
Migration in progress. api.legendary-arena.com and PostgreSQL are moving from Render to a self-hosted DigitalOcean Ubuntu host behind Cloudflare. Render remains rollback-ready until decommission phase.
Deploy Server
Clone or update the application repo on the host, build workspace packages, install the systemd unit, and start or reload the server.
Summary
This page owns infra/scripts/40-app-deploy.ps1 plus the systemd unit at infra/systemd/la-server.service.
Prerequisites
- Node runtime step complete
- PostgreSQL setup complete
- Environment file present at /etc/la/.env with mode 600
- Repository URL and branch/ref identified
Execute
Run as root:
sudo REPO_URL='git@github.com:barefootbetters/legendary-arena.git' \
DEPLOY_REF=main \
pwsh -File infra/scripts/40-app-deploy.ps1
Optional migration execution:
sudo REPO_URL='git@github.com:barefootbetters/legendary-arena.git' \
DEPLOY_REF=main RUN_MIGRATIONS=true \
pwsh -File infra/scripts/40-app-deploy.ps1
Verify
sudo systemctl status la-server --no-pager
sudo journalctl -u la-server -n 100 --no-pager
curl -sS http://127.0.0.1:3000/health
Expected:
- service active
- health endpoint green
- no restart loop in journal
Notes
- The script mirrors the expected build path from managed deployment: install dependencies, build workspace, then run under systemd.
- For rehearsal, point app at a restored database copy, not production.
References
- Plan section 4.5 deploy-server page stub
- Plan section 6 phase sequence