Author: Michael Lynch <git@mtlynch.io>
Committer: Michael Lynch <mtlynch@noreply.codeberg.org>
Configure Fly for one always-running server (#184) Replace the older [[services]] configuration with Fly's current [http_service] shape for a standard HTTP/HTTPS app. The new section maps the same internal port, enables Fly's edge HTTPS redirect with force_https, and keeps the config focused on the one public web service this app exposes. Disable Fly Proxy autostop/autostart by setting auto_stop_machines to "off" and auto_start_machines to false. This matches the deployment model for this app: exactly one server should keep running, the app should not scale down to zero, and Fly should not start extra stopped Machines during traffic spikes. Switch concurrency measurement from connections to requests. Fly recommends the request metric for HTTP services because the proxy can reuse backend connections, while request concurrency better represents the app work being performed. Keep the previous soft and hard limits of 20 and 25. Add an HTTP service health check against /login. The root route requires authentication and redirects, while Fly HTTP checks require a 2xx response and do not follow redirects. Include X-Forwarded-Proto: https so the app's own HTTPS-upgrade middleware does not redirect the check. Fix the proxy environment variable from APP_BEHIND_PROXY to BEHIND_PROXY. The Go server reads BEHIND_PROXY before trusting forwarded client IP headers, so the old variable name did not enable the intended behavior. Add TZ as a runtime environment variable in addition to the Docker build arg so runtime date/time behavior is explicit in the Machine environment. Set a rolling deploy strategy with max_unavailable = 1. With a single Machine, this accepts downtime during deploys instead of requiring extra Machines or bluegreen/canary behavior, which does not fit the desired one-server model. Increase kill_timeout from 5 to 30 seconds to give the entrypoint, app, and Litestream more time to exit cleanly when Fly stops or replaces the Machine. Remove obsolete or redundant config: the empty top-level processes list, empty service check arrays, explicit port handler definitions now covered by http_service, and the old experimental section. Do not add a [mounts] section. This app intentionally does not use a Fly Volume; Litestream and object storage remain responsible for database persistence. Reviewed-on: https://codeberg.org/mtlynch/little-moments/pulls/184
| Time to Start | Worker time | Duration | Time to finish | Idle | |
| Config | 2s | 7s | 7s | 9s | 2s |
| Eval | 7s | 1m39s | 1m39s | 1m47s | 0s |
| Build | 28s | 2m58s | 1m01s | 1m29s | 0s |
| Suite | 2s | 4m45s | 1m45s | 1m47s | 2s |