feat : initial PostgreSQL infrastructure setup
- docker-compose with postgres:16-alpine - Init script to create databases (SIRH + Ferme, prod + recette) - Deploy script with readiness check - Backup script with rotation (keeps last 7) - Auto-tag CI workflow - Full deployment documentation
This commit is contained in:
18
deploy.sh
Executable file
18
deploy.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
echo "==> Pulling PostgreSQL image..."
|
||||
docker compose pull
|
||||
|
||||
echo "==> Starting PostgreSQL..."
|
||||
docker compose up -d
|
||||
|
||||
echo "==> Waiting for PostgreSQL to be ready..."
|
||||
until docker compose exec -T postgres pg_isready -U admin > /dev/null 2>&1; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "==> PostgreSQL is ready."
|
||||
docker compose exec -T postgres psql -U admin -c "SELECT version();"
|
||||
Reference in New Issue
Block a user