d52fa908

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
configuredevShellbackendbackend-devcheck-bashcheck-frontendcheck-go-formattingcheck-go-test-packagescheck-trailing-newlinecheck-trailing-whitespacediagramdocker-imagee2e-testsgo-testsimport-from-tinybeanslint-sqllittle-momentslittle-moments-devx86_64-linux