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 192.168.0.123, then you’d use “http://192.168.0.123:8000” in Safari inside the simulator.