From cd6043ed64b9332aacf2d43d66b54ff5108bc6c5 Mon Sep 17 00:00:00 2001 From: theRADcozaDEV Date: Sun, 15 Mar 2026 11:43:59 +0200 Subject: [PATCH] fix: Properly set port variables in .env for docker compose port mapping --- setup.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 7d4845a..1c8eaa5 100644 --- a/setup.sh +++ b/setup.sh @@ -106,15 +106,17 @@ echo -e "${YELLOW}→ Configuring environment...${NC}" if [ -f "src/.env.${DB}" ]; then cp "src/.env.${DB}" "src/.env" - # Append port configurations to .env (for reference only, not used by Laravel) - # Note: DB_PORT is NOT appended - Laravel uses internal Docker port (3306/5432) - # These are for docker compose external port mapping only + # Append port configurations to .env for docker compose + # These override default ports when conflicts are detected echo "" >> src/.env echo "# Port Configuration (auto-assigned by setup)" >> src/.env - echo "# APP_PORT=$APP_PORT" >> src/.env - echo "# MAIL_DASHBOARD_PORT=$MAIL_DASHBOARD_PORT" >> src/.env - echo "# MAIL_PORT=$MAIL_PORT" >> src/.env - echo "# REDIS_PORT=$REDIS_PORT" >> src/.env + echo "APP_PORT=$APP_PORT" >> src/.env + echo "MAIL_DASHBOARD_PORT=$MAIL_DASHBOARD_PORT" >> src/.env + echo "MAIL_PORT=$MAIL_PORT" >> src/.env + echo "REDIS_PORT=$REDIS_PORT" >> src/.env + if [ -n "$DB_PORT" ]; then + echo "DB_PORT=$DB_PORT" >> src/.env + fi echo -e "${GREEN}✓ Environment configured for ${DB}${NC}" else