rebased-podman/10-create-db.sh
2022-10-24 16:26:16 +01:00

22 lines
460 B
Bash

#!/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