feat: add deployment health and backups
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-09 15:38:31 -04:00
parent f1fd007894
commit 38277b29ec
4 changed files with 81 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
: "${BACKUP_FILE:?Set BACKUP_FILE to a PostgreSQL custom-format dump}"
: "${POSTGRES_DB:?Set POSTGRES_DB}"
: "${POSTGRES_USER:?Set POSTGRES_USER}"
: "${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}"
if [ ! -f "$BACKUP_FILE" ]; then
printf '%s\n' "Backup file not found: $BACKUP_FILE" >&2
exit 1
fi
docker compose -f compose.production.yaml exec -T \
-e PGPASSWORD="$POSTGRES_PASSWORD" postgres \
pg_restore --clean --if-exists --no-owner -U "$POSTGRES_USER" -d "$POSTGRES_DB" < "$BACKUP_FILE"