#!/bin/bash
# kong-start.sh — substitute ${VAR} placeholders in kong.yml, then start Kong.
# Called as the Kong container entrypoint in docker-compose.dev.yml.
# Kong 2.8 does not natively interpolate env vars in declarative config files.
set -euo pipefail

perl -pe 's/\$\{(\w+)\}/$ENV{$1}/ge' /home/kong/temp.yml > /home/kong/kong.yml

exec /docker-entrypoint.sh kong docker-start
