How to access docker app from apple simulator

I have a web app running in a docker container and it is exposing port 8000 to the host. Using the browser, http://localhost:8000 runs my application as expected. However, when I specify the same url in Safari from the Apple iPhone simulator I see the error: “Safari cannot open the page because the network connection was lost.”

How do I configure my network so the simulator can run my docker application?

Instead of referencing “localhost” in your URL, use the IP address of your laptop (I’m assuming you’re using a MacBook) and use the same port reference. For example, if the IP address of your MacBook is, then you’d use “” in Safari inside the simulator.