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
...
CodePudding user response:
As you can see here:
0.0.0.0:8000->8000
Docker is mapping the port 8000 of your container to the port 8000 to 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).
CodePudding user response:
You would use port 8000 and host as either localhost or 127.0.0.1 or 0.0.0.0.