Adding the Recovery Service
The Compose recovery service keeps backup policy, jobs, release archives, and restore targets outside the application process. Provision its repository independently before relying on it.
The backups profile runs the existing independent recovery worker. Its
policy, release archive, socket, and restore targets use durable named
volumes. It stays alive during app/DB outages. The supplied package uses a
mounted repository; provision an independently durable/off-machine mount
before enabling it. App and Caddy have no access to the repository or restored
databases. The backup container has only the internal database network and no
Internet route. A direct S3/SFTP repository needs an explicitly restricted
egress setup before using it here.
Follow the recovery runbook for keys, retention, verification and cutover semantics. Before enabling the profile:
- Create
/srv/acta-config/backupmode 0700. Copydeploy/production/backup.example.jsonasbackup.jsonanddeploy/production/pgbackrest.example.confaspgbackrest.conf, both mode - Supply a random repository cipher password in
pgbackrest.conf. Provisionrecovery.ageprivately in that directory and its public recipient inbackup.json; retain independent recovery copies. The worker's UID 999 needs read/write access to the repository mount; give only that account access. - Write a private
backup/database-urlcontainingpostgres://postgres@/acta?host=/var/run/postgresql. This uses the private shared PostgreSQL socket and local authentication, not a published administrator port. Only the database and recovery worker mount that socket. - Set
ACTA_BACKUP_REPOSITORYin.envto the absolute provisioned mount path. The deployment refuses to create a missing mount directory. The worker copies operator files privately into its durable configuration area and archives the exact server executable on each start. Keep app and worker on the same image build/release; include both when updating, and take a new full backup afterward. - Start the worker first to prepare its config, then enable DB archiving
using the additional Compose file. The worker starts with automatic
schedules disabled. Its image copies
acta-backupfrombin/, whichtools/exportwrites:
Retain both Compose files and the profile for subsequent starts. Monitor WAL
disk usage immediately: failed archiving retains WAL on the database disk.
Configure policy in Site Settings, take a full backup and pass a restore drill
before relying on it. Configure a reachable independent alert mechanism and
external uptime monitor. To run offline recovery, use
docker compose run --rm --no-deps backup with the worker's flags preceding
restore; restore never starts app workers. Replicate the release archive and
recovery credentials independently along with repository data. A local named
volume alone is not disaster recovery.