feat: add PostgreSQL + entrypoint, Python, uv, pnpm
Docker / build-and-push (push) Successful in 1m59s
Docker / build-and-push (push) Successful in 1m59s
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#!/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 "$@"
|
||||
Reference in New Issue
Block a user