Files
Steffen b0fd104512
Docker / build-and-push (push) Successful in 1m59s
feat: add PostgreSQL + entrypoint, Python, uv, pnpm
2026-06-13 15:38:08 +00:00

20 lines
704 B
Bash

#!/bin/sh
set -e
PGDATA="/var/lib/postgresql/data"
PGLOG="/var/log/postgresql.log"
if [ ! -d "$PGDATA" ] || [ -z "$(ls -A "$PGDATA" 2>/dev/null)" ]; then
mkdir -p /run/postgresql
chown postgres:postgres /run/postgresql
su - postgres -c "initdb -D $PGDATA"
su - postgres -c "pg_ctl -D $PGDATA -l $PGLOG start"
su - postgres -c "psql -c \"CREATE USER remynd WITH PASSWORD 'remynd';\"" || true
su - postgres -c "psql -c \"CREATE DATABASE remynd_dev OWNER remynd;\"" || true
su - postgres -c "psql -d remynd_dev -c 'CREATE EXTENSION IF NOT EXISTS vector;'" || true
su - postgres -c "pg_ctl -D $PGDATA stop"
fi
su - postgres -c "pg_ctl -D $PGDATA -l $PGLOG start"
exec "$@"