diff --git a/docker-compose.yaml b/docker-compose.yaml index f5f94a09..f7792782 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -58,7 +58,7 @@ services: - API_PROXY_TARGET=http://baron_backend:3000 - USERFRONT_URL=${USERFRONT_URL} ports: - - "${ADMIN_PORT:-5173}:5173" + - "${ADMINFRONT_PORT:-5173}:5173" volumes: - ./adminfront:/app - ./locales:/locales diff --git a/docker/staging_pull_compose.template.yaml b/docker/staging_pull_compose.template.yaml index 27ac061d..9e059e5a 100644 --- a/docker/staging_pull_compose.template.yaml +++ b/docker/staging_pull_compose.template.yaml @@ -383,7 +383,7 @@ services: - APP_ENV=${APP_ENV:-development} - API_PROXY_TARGET=http://baron_backend:3000 ports: - - "${ADMIN_PORT:-5173}:5173" + - "${ADMINFRONT_PORT:-5173}:5173" volumes: - ./adminfront:/app - /app/node_modules diff --git a/test/adminfront_port_env_policy_test.sh b/test/adminfront_port_env_policy_test.sh new file mode 100644 index 00000000..216d93e2 --- /dev/null +++ b/test/adminfront_port_env_policy_test.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" + +EXPECTED_FILES=( + "$ROOT_DIR/docker-compose.yaml" + "$ROOT_DIR/docker/staging_pull_compose.template.yaml" + "$ROOT_DIR/docker/docker-compose.staging.template.yaml" +) + +for file in "${EXPECTED_FILES[@]}"; do + if [[ ! -f "$file" ]]; then + echo "ERROR: expected file not found: $file" + exit 1 + fi +done + +legacy_refs="$(grep -R -n '\${ADMIN_PORT:-' "${EXPECTED_FILES[@]}" || true)" +if [[ -n "$legacy_refs" ]]; then + echo "ERROR: legacy ADMIN_PORT references remain" + echo "$legacy_refs" + exit 1 +fi + +for file in "${EXPECTED_FILES[@]}"; do + if ! grep -q '\${ADMINFRONT_PORT:-5173}:5173' "$file"; then + echo "ERROR: ADMINFRONT_PORT mapping missing in $file" + exit 1 + fi +done + +echo "OK: AdminFront compose port policy uses ADMINFRONT_PORT only"