Initial postgres skill implementation

This commit is contained in:
Azat
2026-02-02 23:43:53 +01:00
commit 0ec5022920
3 changed files with 238 additions and 0 deletions

20
scripts/run.sh Normal file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e
POSTGRES_VERSION="${POSTGRES_VERSION:-16}"
POSTGRES_DATA_DIR="${POSTGRES_DATA_DIR:-/data/postgres}"
POSTGRES_PORT="${POSTGRES_PORT:-5432}"
POSTGRES_USER="${POSTGRES_USER:-vibestack}"
POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-vibestack}"
POSTGRES_DB="${POSTGRES_DB:-vibestack}"
# Export DATABASE_URL for other services
export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:${POSTGRES_PORT}/${POSTGRES_DB}"
echo "DATABASE_URL=$DATABASE_URL"
# Write to shared env file for other skills
mkdir -p /run/vibestack
echo "DATABASE_URL=$DATABASE_URL" > /run/vibestack/postgres.env
echo "Starting PostgreSQL on port $POSTGRES_PORT..."
exec su - postgres -c "/usr/lib/postgresql/${POSTGRES_VERSION}/bin/postgres -D '$POSTGRES_DATA_DIR'"