fix produc domain name for the image creation

This commit is contained in:
root
2026-06-04 01:29:47 -04:00
parent 03f6c26940
commit 8d479b050d
2 changed files with 27 additions and 0 deletions
+16
View File
@@ -139,6 +139,22 @@ build_image:
- echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY_HOST" -u "$REGISTRY_USER" --password-stdin
script:
- echo "--- Building Docker Image ---"
- |
for var_name in NEXT_PUBLIC_API_URL NEXT_PUBLIC_MARKETPLACE_URL NEXT_PUBLIC_DASHBOARD_URL NEXT_PUBLIC_ADMIN_URL; do
var_value="$(printenv "$var_name" || true)"
if [ -z "$var_value" ]; then
echo "$var_name is not set. Refusing to build a production image with missing public frontend URLs." >&2
exit 1
fi
case "$var_value" in
*example.com*)
echo "$var_name=$var_value still uses the placeholder example.com domain. Update the GitLab CI/CD variable before building." >&2
exit 1
;;
esac
done
# NEXT_PUBLIC_* vars are inlined into Next.js bundles at build time — must be passed as ARGs
- |
docker build \