# Backup sidecar image: Postgres client tools (pg_dump/psql) + openssl for # at-rest encryption of dumps. # # The scripts are bind-mounted live at runtime (see the `backup` service in # docker-compose.yml) so they can be edited without a rebuild -- but they're # ALSO baked in here as a fallback default under /app/scripts-default/. # entrypoint.sh prefers the live mount and only falls back to this baked-in # copy if the mount is missing, empty, or stale. That fallback is what keeps # a broken bind mount from crash-looping the container into an unreachable # state (see entrypoint.sh for the full story). FROM postgres:16-alpine RUN apk add --no-cache openssl COPY scripts/backup-cron.sh scripts/db-backup.sh scripts/db-restore.sh /app/scripts-default/ COPY scripts/entrypoint.sh /app/entrypoint.sh RUN chmod +x /app/entrypoint.sh /app/scripts-default/*.sh ENTRYPOINT ["/app/entrypoint.sh"] CMD []