mirror of
https://github.com/hohn/mrvactl.git
synced 2026-05-15 03:39:40 +02:00
Root causes fixed during shell-first MRVA bring-up: 1. set -e + sourced script calling exit (ensure-pg-volume.sh aborted caller) 2. Probe scripts conflated “running” vs “ready” semantics 3. Missing explicit wait/retry logic for service readiness 4. Environment variables defined but not exported (env.sh) 5. Hidden Docker Compose behavior (RabbitMQ users/queues/permissions) 6. RabbitMQ definitions file mounted but not actually loaded 7. Misleading RabbitMQ auth errors (user did not exist vs wrong password) 8. Host vs container naming confusion (localhost / host.docker.internal / DNS) 9. Containers not placed on a shared user-defined Docker network 10. Service name mismatch (postgres vs mrva-postgres) 11. Ambiguous HEPC endpoint semantics (container → host access) Outcome: system now boots deterministically using explicit shell orchestration.
30 lines
620 B
Bash
Executable File
30 lines
620 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
HERE="$(dirname "$0")"
|
|
. "$HERE/ensure-pg-volume.sh"
|
|
. "$HERE/ensure-mrva-network.sh"
|
|
|
|
NAME=mrva-postgres
|
|
|
|
# running → no-op
|
|
if docker ps --format '{{.Names}}' | grep -qx "$NAME"; then
|
|
exit 0
|
|
fi
|
|
|
|
# stopped → disposable
|
|
if docker ps -a --format '{{.Names}}' | grep -qx "$NAME"; then
|
|
docker rm "$NAME"
|
|
fi
|
|
|
|
docker run -d \
|
|
--network mrva\
|
|
--name "$NAME" \
|
|
--network-alias postgres \
|
|
-p 5432:5432 \
|
|
-v mrva-pgdata:/var/lib/postgresql/data \
|
|
-e POSTGRES_USER=mrva \
|
|
-e POSTGRES_PASSWORD=mrvapg \
|
|
-e POSTGRES_DB=mrvadb \
|
|
postgres:15
|