I'm deploying the medplum/medplum-app:latest Docker image to Google Cloud Run and trying to configure the backend API URL using the MEDPLUM_BASE_URL environment variable. The image includes the standard docker-entrypoint.sh that uses sed to replace placeholders like __MEDPLUM_BASE_URL__ in the static assets.
I've set MEDPLUM_BASE_URL=
https://fhir.precisionlongevity.io/ in my Cloud Run service configuration. I've even added debug echo statements to a custom version of the entrypoint script (based on the public one), and my Cloud Run container logs confirm:
MY_DEBUG_ENTRYPOINT: Initial MEDPLUM_BASE_URL from environment is [
https://fhir.precisionlongevity.io/]
MY_DEBUG_ENTRYPOINT: MEDPLUM_BASE_URL after default assignment is [
https://fhir.precisionlongevity.io/]
The entrypoint script appears to complete, and echo "Environment variable replacement complete." is logged before Nginx starts.
Despite this, when I access the deployed medplum-app UI in my browser (after IAP authentication), the browser console shows the error: Error: Base URL must start with http or https.
Even when I remove MEDPLUM_BASE_URL from my Cloud Run environment variables (which should cause the entrypoint script's default of
http://localhost:8103/ to be used for the sed replacement), I still get the exact same "Base URL must start with http or https" error.
This leads me to believe that the __MEDPLUM_BASE_URL__ placeholder (and possibly others) might be missing from the static JavaScript assets within the current medplum/medplum-app:latest image, or there's another issue preventing the sed replacement from taking effect on the client-side bundle.
Could you confirm if the __MEDPLUM_BASE_URL__ placeholder is expected to be in the JS assets of medplum/medplum-app:latest for the entrypoint script's sed replacement to work? Is there an alternative or recommended way to provide this runtime configuration for the Docker image on platforms like Cloud Run?
Thanks for any insights!