Production target: a single Ubuntu VPS, root access, Nginx reverse proxy, systemd-managed.
dotnet publish the API and copy the output to /opt/insightstream/opt/insightstream/.env (systemd EnvironmentFile) β never in
appsettings.jsondotnet ef database update against the production connection stringdeploy/insightstream.service and deploy/nginx.conf, then certbot --nginxdeploy/ingest-relay.phpThe full, copy-pasteable walkthrough β including exact apt commands, the systemd unit, the
Nginx server block, the admin-password rotation procedure, and a curl smoke-test sequence for
every endpoint β lives in deploy/deploy.md
at the repository root (kept there, next to the artifacts it references, rather than duplicated
here).
1
2
3
4
cPanel mail server ββ(PHP relay pipes raw email)βββΆ VPS: Nginx βββΆ InsightStream.Api
β
hosts the ingest consumer too
(single-deployment simplicity)
Nginx terminates TLS (via certbot) and enforces client_max_body_size 10m to match the APIβs own
Ingest:MaxRequestBodyBytes / Kestrel MaxRequestBodySize limit β keep both in sync if you
change it.
The consumer runs today as an IHostedService inside the API process. If ingest volume ever
justifies scaling it independently, deploy/deploy.md Β§14 covers extracting it into its own
InsightStream.Worker project and systemd unit β no database or queue schema changes required,
since both are already shared, decoupled state.