a6a46af12e
Run the HTTP server in a goroutine and, on SIGINT/SIGTERM, call srv.Shutdown so it stops accepting connections and lets in-flight requests finish before exiting (ErrServerClosed is a clean exit). This stops uploads/streams being cut when the container is stopped or recreated on deploy. The drain deadline is configurable via SHUTDOWN_TIMEOUT (default 15s). docker-compose.yml feeds the same variable into the app's stop_grace_period, so Docker won't SIGKILL mid-drain and the two values can't drift. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>