#!/bin/sh # Convivo Admin app — container entrypoint. # # Injects the Supabase proxy target into the nginx config template, then starts # nginx. The target defaults to the Kong container on the shared Supabase # network (supabase_kong_Convivo:8000 — Kong's internal port; 54321 is the # host-only mapping). Override with SUPABASE_PROXY_TARGET # (e.g. host.docker.internal:54321) if the core is not on the shared network. set -eu TARGET="${SUPABASE_PROXY_TARGET:-supabase_kong_Convivo:8000}" SIDECAR="${SIDECAR_TARGET:-convivo-sidecar:3002}" TEMPLATE=/etc/nginx/conf.d/default.conf.template CONF=/etc/nginx/conf.d/default.conf echo "[convivo-admin] Proxying Supabase paths to: ${TARGET}" echo "[convivo-admin] Proxying /sidecar/ to: ${SIDECAR}" sed -e "s|__SUPABASE_PROXY_TARGET__|${TARGET}|g" \ -e "s|__SIDECAR_TARGET__|${SIDECAR}|g" "${TEMPLATE}" > "${CONF}" # Run nginx in the foreground. exec nginx -g "daemon off;"