saleor-dashboard/nginx/replace-api-url.sh
Krzysztof Żuraw ac063c6410
Update Dockerfile (#2523)
Co-authored-by: Francisco Marques <franciscopcmarques@gmail.com>
2022-11-16 16:01:34 +01:00

16 lines
433 B
Bash
Executable file

#!/usr/bin/env sh
# Replaces the API_URL from the bundle's index.html file with the $API_URL env var.
# This script is automatically picked up by the nginx entrypoint on startup.
set -e
INDEX_BUNDLE_PATH="/app/dashboard/index.html"
if [ -z "${API_URL}" ]; then
echo "No API_URL provided, using defaults."
else
echo "Setting API_URL to: $API_URL"
sed -i "s#API_URL:.*#API_URL: \"$API_URL\",#" "$INDEX_BUNDLE_PATH"
fi