Productionize EventSphere platform
This commit is contained in:
15
backup-prod.sh
Normal file
15
backup-prod.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ENV_FILE="${ENV_FILE:-.env.production}"
|
||||
COMPOSE_FILE="${COMPOSE_FILE:-docker-compose.prod.yml}"
|
||||
OUT_DIR="${OUT_DIR:-./backups}"
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
|
||||
timestamp="$(date +%Y%m%d_%H%M%S)"
|
||||
outfile="$OUT_DIR/eventsphere_${timestamp}.dump"
|
||||
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T postgres pg_dump -U eventsphere -d eventsphere -Fc > "$outfile"
|
||||
|
||||
echo "$outfile"
|
||||
Reference in New Issue
Block a user