fix: Write port config to project root .env for docker compose
This commit is contained in:
16
setup.sh
16
setup.sh
@@ -106,16 +106,14 @@ echo -e "${YELLOW}→ Configuring environment...${NC}"
|
||||
if [ -f "src/.env.${DB}" ]; then
|
||||
cp "src/.env.${DB}" "src/.env"
|
||||
|
||||
# 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
|
||||
# Create .env in project root for docker compose port mapping
|
||||
echo "# Docker Compose Port Configuration (auto-assigned by setup)" > .env
|
||||
echo "APP_PORT=$APP_PORT" >> .env
|
||||
echo "MAIL_DASHBOARD_PORT=$MAIL_DASHBOARD_PORT" >> .env
|
||||
echo "MAIL_PORT=$MAIL_PORT" >> .env
|
||||
echo "REDIS_PORT=$REDIS_PORT" >> .env
|
||||
if [ -n "$DB_PORT" ]; then
|
||||
echo "DB_PORT=$DB_PORT" >> src/.env
|
||||
echo "DB_PORT=$DB_PORT" >> .env
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}✓ Environment configured for ${DB}${NC}"
|
||||
|
||||
Reference in New Issue
Block a user