modify port mapping to read from env

This commit is contained in:
SennayT
2026-05-28 14:26:46 +03:00
parent 4b8f1b3ab1
commit e5ffa91918
2 changed files with 11 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ services:
secrets:
- npmrc
ports:
- "${PORT:-3001}:${PORT:-3001}"
- "${FREIGHT_API_PORT:-3001}:${FREIGHT_API_PORT:-3001}"
env_file:
- apps/edr-freight-api/.env
@@ -22,7 +22,7 @@ services:
context: .
dockerfile: apps/edr-passenger-api/Dockerfile
ports:
- "${PORT:-4000}:${PORT:-4000}"
- "${PASSENGER_API_PORT:-4000}:${PASSENGER_API_PORT:-4000}"
env_file:
- apps/edr-passenger-api/.env
@@ -38,7 +38,7 @@ services:
secrets:
- npmrc
ports:
- "${PORT:-5173}:80"
- "${FREIGHT_PORTAL_PORT:-5173}:80"
freight-backoffice:
build:
@@ -51,7 +51,7 @@ services:
secrets:
- npmrc
ports:
- "${PORT:-5183}:80"
- "${FREIGHT_BACKOFFICE_PORT:-5183}:80"
passenger-portal:
build:
@@ -62,7 +62,7 @@ services:
APP_PATH: apps/edr-passenger-web/portal
VITE_API_URL: ${PASSENGER_VITE_API_URL:-http://localhost:4000}
ports:
- "${PORT:-5174}:80"
- "${PASSENGER_PORTAL_PORT:-5174}:80"
passenger-backoffice:
build:
@@ -73,7 +73,7 @@ services:
APP_PATH: apps/edr-passenger-web/backoffice
VITE_API_URL: ${PASSENGER_VITE_API_URL:-http://localhost:4000}
ports:
- "${PORT:-5184}:80"
- "${PASSENGER_BACKOFFICE_PORT:-5184}:80"
secrets:
npmrc:

View File

@@ -56,11 +56,11 @@ for service in "$@"; do
exit 1
fi
# if [[ -n "${GITHUB_ENV:-}" ]]; then
# service_var=$(echo "${service}" | tr '[:lower:]-' '[:upper:]_')
# echo "${service_var}_PORT=${port_value}" >> "${GITHUB_ENV}"
# echo "Exported ${service_var}_PORT from ${src}"
# fi
if [[ -n "${GITHUB_ENV:-}" ]]; then
service_var=$(echo "${service}" | tr '[:lower:]-' '[:upper:]_')
echo "${service_var}_PORT=${port_value}" >> "${GITHUB_ENV}"
echo "Exported ${service_var}_PORT from ${src}"
fi
done
# Optional build-time variables (VITE_API_URL, etc.)