14 lines
387 B
Bash
14 lines
387 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ $# -lt 1 ]]; then
|
|
echo "Usage: ./restore-prod.sh <path-to-dump>"
|
|
exit 1
|
|
fi
|
|
|
|
ENV_FILE="${ENV_FILE:-.env.production}"
|
|
COMPOSE_FILE="${COMPOSE_FILE:-docker-compose.prod.yml}"
|
|
DUMP_FILE="$1"
|
|
|
|
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" exec -T postgres pg_restore -U eventsphere -d eventsphere --clean --if-exists < "$DUMP_FILE"
|