[Unit] Description=SEO Insight — analytics ETL service (Bun + Hono + DuckDB) After=network.target postgresql.service Wants=postgresql.service [Service] Type=simple User=seoinsight Group=seoinsight WorkingDirectory=/opt/seo-insight EnvironmentFile=/opt/seo-insight/.env.production # PORT set here (not in the shared env file) so the web app's `next start -p 3000` # is never affected. The service stays internal; only Next reaches it via # ANALYTICS_URL=http://localhost:8787. Keep port 8787 closed in the firewall. Environment=PORT=8787 # F3 (docs/project/ops/serveur-prod.md) : bind loopback — seul le web local consomme. Environment=HOST=127.0.0.1 ExecStart=/home/seoinsight/.bun/bin/bun --conditions=react-server services/analytics/src/index.ts Restart=on-failure RestartSec=5 NoNewPrivileges=true ProtectSystem=full PrivateTmp=true [Install] WantedBy=multi-user.target