#!/bin/bash # # Production launcher: Server::Starter + Starman in the foreground so the # container lifecycle tracks the app. Dependency binaries come from the # Carton-managed ./local/bin, already on PATH via the Dockerfile ENV. # set -e cd /home/lacuna/server/bin # Bring the database up to date before serving traffic -- see migrate_db.pl. perl migrate_db.pl # --max-requests recycles each worker individually after it's handled that # many requests. Workers don't all reach this count at the same wall-clock # moment, so recycling is naturally staggered across the 7 of them -- this is # our bound on unbounded per-worker memory growth now that the old # Plack::Middleware::SizeLimit/harakiri safety valve (see lacuna.psgi, # disabled in prod via TLE_NO_MIDDLEWARE) is retired: that middleware has a # documented history of causing crashes of its own, so we're not reintroducing # it. Start conservative and retune from production log/memory observations # (see deployment repo CLAUDE.md) rather than treating 1500 as final. exec start_server --port 5000 -- starman --workers 7 --max-requests 1500 --preload-app lacuna.psgi