Something went wrong. Try again.
Substratum: DID-native private IPFS infrastructure for the AT Protocol. Your identity is the access key. substratum.cloud
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#!/usr/bin/env bash# Thin wrapper around `docker compose` for this repo.## Problem: Cursor binds forwardPorts on 127.0.0.1. Podman rootless cannot also# publish those same ports on 0.0.0.0. docker-compose.podman.yml republishes them# on PODMAN_PUBLISH_HOST (a LAN address) instead.## On Podman this wrapper:# 1. Sets COMPOSE_FILE = docker-compose.yml [+ caller overlays] + docker-compose.podman.yml# [+ overlay.podman.yml when present, e.g. docker-compose.trusted-space.podman.yml]# 2. Removes caller `-f *.yml` flags so Compose does not open those files twice# 3. Leaves other `-f` alone (e.g. `exec … sh -c 'test -f /path'`)## On Docker Engine it still URL-encodes POSTGRES_* then runs compose (no COMPOSE_FILE rewrite).## Usage (repo root):# bash scripts/dev/docker-compose.sh --profile gateway up -d gateway file-explorer edge# bash scripts/dev/docker-compose.sh -f docker-compose.fs.yml --profile gateway up -d …set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"# shellcheck disable=SC1091source "${ROOT}/scripts/lib/podman-compose-env.sh"
cd "${ROOT}"
# URL-encode POSTGRES_* for Compose DATABASE_URL interpolation on every engine.# A raw password with / @ : or # yields "invalid port number" in pds-upstream.substratum_compose_export_postgres_urlencoded() { if [ -f "${ROOT}/.env" ]; then set -a # shellcheck disable=SC1091 source "${ROOT}/.env" set +a fi if [ -f "${ROOT}/scripts/lib/encode-postgres-url-env.mjs" ]; then eval "$(node "${ROOT}/scripts/lib/encode-postgres-url-env.mjs")" export POSTGRES_USER POSTGRES_PASSWORD_URLENCODED fi}
if ! substratum_docker_is_podman; then substratum_compose_export_postgres_urlencoded exec docker compose "$@"fi
extras=()substratum_compose_collect_extra_yaml_basenames extras "$@"substratum_export_podman_compose_env "${ROOT}" "${extras[@]+"${extras[@]}"}"
argv=()substratum_compose_argv_without_yaml_file_flags argv "$@"exec docker compose "${argv[@]}"