- Deployment with Docker
- Srdjan Grubor
- 117字
- 2021-07-02 23:22:13
Exposing ports
Our next new directive here is EXPOSE 8000. Remember how we used docker info to find out what port the NGINX container was using? This directive filled in that information in the metadata and is used by the Docker orchestration tooling to map incoming ports into the right ingress port on the container. Since Python's HTTP server starts its service on port 8000 by default, we use EXPOSE to inform Docker that whoever uses this container should make sure that they map this port on the host. You can also list multiple ports here with this directive but since our service is using only one, we will not need to use that right now.
推薦閱讀