rebased-podman/10-create-db.sh

23 lines
460 B
Bash
Raw Normal View History

2022-10-24 17:24:43 +02:00
#!/bin/bash
first=false
if [[ ! -d ./postgres ]]; then
mkdir ./postgres
$first=true
fi
podman run -d \
--name pleroma-db \
--pod pleroma-pod \
-e POSTGRES_USER=pleroma \
-e POSTGRES_PASSWORD=CHANGHEME \
-e POSTGRES_DB=pleroma \
-v ./postgres:/var/lib/postgresql/data \
postgres:12.1-alpine
if [[ $first == true ]]; then
podman exec -i pleroma-db psql -U pleroma -c "CREATE EXTENSION IF NOT EXISTS citext;"
exit 0
fi