- scripts/prod: entrypoint, db-setup and schema.sql shipped in the image - scripts/dev: seed/clear db, psql and cleanup, run natively in the devcontainer instead of via docker-compose - move setup.cfg to the repo root so linters pick it up - Makefile targets run directly in the devcontainer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
454 B
Bash
Executable File
21 lines
454 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "start db setup"
|
|
|
|
if [ -z "$PGSQL_HOST" ]; then
|
|
echo "Note: Postgresql not set!!"
|
|
exit 1;
|
|
fi
|
|
|
|
export PGSQL_PORT="${PGSQL_PORT:-5432}"
|
|
|
|
wait-for-it --timeout=15 "$PGSQL_HOST:$PGSQL_PORT"
|
|
|
|
# Create schema in postgresql
|
|
export PGPASSWORD="$PGSQL_PASSWORD"
|
|
psql -1 -v ON_ERROR_STOP=1 -h "$PGSQL_HOST" -p "$PGSQL_PORT" -U "$PGSQL_USER" -d "$PGSQL_NAME" -f "$(dirname "${BASH_SOURCE[0]}")/schema.sql"
|
|
|
|
echo "end db setup"
|