Production topology
The reverse proxy owns public TLS, request-size limits, and forwarded headers. Archery listens on a private loopback port and handles application requests.Compile the application
From the project root:Compiling the executable does not embed application files that your code reads from disk. Deploy
lib/src/config, lib/src/http/views, and lib/src/http/public when your application uses them.Bind to a private address
When NGINX or Caddy runs on the same host, bind Archery to loopback:Inject secrets
Committed JSON files should contain non-sensitive defaults. Read production secrets from the process environment and apply them before providers that depend on them boot:Run under systemd
A service unit keeps the application running and restarts it after recoverable failures:Proxy through NGINX
The following server block terminates public traffic and forwards requests to Archery:Set application response headers
Apply explicit security headers and configure CORS for the origins that should access the application:Shut down cleanly
Closing the listener stops new requests. Dispose the container to run registered cleanup callbacks, then shut down the application lifecycle:Verify the release
Before directing public traffic to a new release:- Confirm the service starts without provider or migration errors.
- Request a dedicated health endpoint.
- Verify that templates and static assets are present.
- Confirm the application can reach its Postgres connection.
- Test authentication cookies over HTTPS.
- Submit a state-changing form and verify CSRF protection.
- Confirm CORS rejects untrusted origins.
- Inspect service and reverse-proxy logs.
- Exercise shutdown and restart behavior.
- Preserve the previous executable and runtime files for rollback.
Architecture
Review application boot and shutdown responsibilities.
Configuration
Learn how configuration is loaded and overridden.