Search code examples
dockerdocker-desktop

How to access docker container listening on 0.0.0.0:8000


I am new to Docker and trying to run an open-source Django application with Docker Desktop for Windows.

Command docker container ls shows the application is running, and the service is listening on port 0.0.0.0:8000.

What IP address should I use on the Windows host to access this service? I appreciate your help.

docker container ls

...
1f2c70d56d48   saleor-platform_api          "python manage.py ru…"   23 minutes ago   Up 23 minutes   0.0.0.0:8000->8000/tcp
                                                               saleor-platform-api-1
...

Solution

  • As you can see here:

    0.0.0.0:8000->8000

    Docker is mapping the port 8000 of your container to the port 8000 of the host. Therefore, to send a request to the container, you need to make a request to localhost:8000 from the host (Windows in your case).