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
+36
View File
@@ -45,6 +45,42 @@ worker images share the same Node workspace image; the web image builds the Vue
application and serves it through Nginx with SPA fallback and internal `/api`
proxying.
## Health Checks
Production Compose waits for healthy PostgreSQL, Redis, and API services before
starting the web service. The API health endpoint is `GET /health`; the web
container checks its `/health` response through Nginx.
## Backup And Restore
Create a PostgreSQL custom-format dump from the running production stack:
```sh
BACKUP_DIR=/secure/backups \
POSTGRES_DB=inventory \
POSTGRES_USER=inventory \
POSTGRES_PASSWORD='use-secret-storage' \
./scripts/backup-postgres.sh
```
Restore only during a planned maintenance window because `pg_restore` replaces
matching database objects:
```sh
BACKUP_FILE=/secure/backups/inventory-20260909T000000Z.dump \
POSTGRES_DB=inventory \
POSTGRES_USER=inventory \
POSTGRES_PASSWORD='use-secret-storage' \
./scripts/restore-postgres.sh
```
Back up image storage and the deployment `.env` through the NAS secret/backup
system as well. Never commit either one. Before upgrading, record the current
image tags and database migration state. To roll back, stop the application
services, restore the previous image tags, restore the database dump if the
schema changed, then start the stack and verify `/health` and a read-only
catalog request.
## Reverse proxy
Responsible for: