2025-10-07 06:23:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
# Starts a Postgres container using Apple's `container` tool:
|
|
|
|
|
# https://github.com/apple/container
|
|
|
|
|
#
|
|
|
|
|
# You'll need to use `container list` to find the new container's IP address in
|
|
|
|
|
# order to connect to it from the Phonograph server.
|
|
|
|
|
|
|
|
|
|
if ! (container volume ls | grep 'phono-pg'); then
|
|
|
|
|
container volume create -s 2G phono-pg
|
|
|
|
|
fi
|
|
|
|
|
container run --name phono-pg \
|
|
|
|
|
-e POSTGRES_USER=postgres \
|
|
|
|
|
-e POSTGRES_PASSWORD=guest \
|
|
|
|
|
-e PGDATA=/var/lib/postgresql/18/docker/pgdata \
|
2025-11-22 06:30:50 +00:00
|
|
|
-v "$(realpath "$(dirname "$0")")/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro" \
|
2025-10-07 06:23:50 +00:00
|
|
|
-v phono-pg:/var/lib/postgresql/18/docker \
|
|
|
|
|
postgres:18
|