Medplum v4.1.4 failing with base URL
# support
a
Hello everyone, how are you? I'm installing a new version of Medplum on Docker, on a separate server. When configuring the variables in docker-compose.full-stack.yml, I changed the localhost variables to the server's DNS. Something strange is happening: when typing https://servidor.saude.com.br, Medplum fails to connect, using CORS, indicating a URL http://localhost:8103/fhir/R4/$graphql. Then, if we refresh the page (F5 in the browser), it redirects to https://servidor.saude.com.br/signin, showing the login screen. Can you tell me if this is an application problem or if I need to do some additional configuration? Thank you in advance, you are an incredible community! Thanks! https://cdn.discordapp.com/attachments/1372341182486548682/1372341183036264448/Captura_de_tela_de_2025-05-14_19-32-15.png?ex=68266bd2&is=68251a52&hm=29a88c025cf8944c2510c21355b0fdb04123ce73ba452af115aa6306aaa69b25&
r
What's in your Update the medplum.config.json file? Is it populated with your domain: { "baseUrl": "https://servidor.saude.com.br/", // ... } After editing this file, restart the Medplum service: sudo systemctl restart medplum
a
Thank you very much for replying reshma! Well, my medplum.config.json file is configured correctly. I included the new domains in it. I also configured the environment variables for docker-compose.full-stack.yml. After configuring, I went to the server and ran docker compose -f 'docker-compose.full-stack.yml' up -d --build. Then I'm getting CORS errors, both for logging in and registering a new user. And when I check the link, it's pointing to "localhost". I'll leave here another screenshot of the URL that is calling "localhost". https://cdn.discordapp.com/attachments/1372341182486548682/1372385388626186280/Captura_de_tela_2025-05-14_222712.png?ex=682694fe&is=6825437e&hm=087640d76928de78fd77856f279c1d0dd9182353bc8f8bfb2c33549dd461805d&
Good morning Reshma; Doing a more in-depth analysis of the code today for Docker, I realized that the image used from Docker Hub is not using the /packages/app/.env.default file. As a result, when it uses docker-entrypoint.sh, the JavaScript files are not being replaced by the URL I need, which would be the server's https://myserver.com Therefore, when we edit the docker-compose.full-stack.yml file, the environment variables only work for the Server container, but the Web UI application container does not have this information. Can you help me understand how to use Medplum on a private server using Docker? Thank you very much for your help! https://cdn.discordapp.com/attachments/1372341182486548682/1372576672649314534/Captura_de_tela_2025-05-15_110703.png?ex=68274724&is=6825f5a4&hm=fd754b101e33ddd9cdf101a6fddf2acec8beea20b27494569aa8ffda1001a080& https://cdn.discordapp.com/attachments/1372341182486548682/1372576673102303333/Captura_de_tela_2025-05-15_110750.png?ex=68274724&is=6825f5a4&hm=f50bf3a81b4982ecb5be850363e151acfd466aff603b2a06d696828cf8aa3ac3&
d
Hi sorry there was a bug in the
docker-entrypoint.sh
, which will be fixed here: https://github.com/medplum/medplum/pull/6628 We will need to get a new image out and then your env var replacement should work. Sorry about that!
Also just for clarity I want to mention that
.env.defaults
will not work out of the box for the
medplum/medplum-app
Docker image and is meant for a locally built Medplum app. Using just
.env
should work in the directory where you are keeping the
docker-compose.full-stack.yml
file, though
a
Thank you very much for the quick response and adjustment, Derrick, you guys are amazing! Brazil will certainly be privileged with this work. What we are achieving here, with your support, is something very big! I and the entire Brazilian health sector are grateful for the support. I look forward to further information.
Good afternoon Derrick. One question: Why doesn't the container image downloaded from Docker Hub have the updated docker-entrypoint? I don't understand why when I run docker-compose.full-stack.yml, even with the .env in the project root and with the variables replaced for the server IP, it's not working, it's always using http://localhost:8103. Can you tell me which locations I need to change to run docker-compose.full-stack.yml and have the service start using the configured IPs?
d
Hi @Adriano Freitas, sorry about the delayed response! Did you check that you pulled the latest images? I'm not sure Docker Compose will automatically pull the latest, so if you didn't already, you might want to try:
docker pull medplum/medplum-app
and get the latest or try running
docker compose up -d --pull
to get all the latest containers
162 Views