What does `EXPOSE` actually do?
IntermediateConceptDockerfile Instructions & Builds
Answer
It is documentation metadata only; it does not publish the port. -p host:container publishes. -P publishes all EXPOSEd ports to random high host ports. Tools and Compose can use the metadata, but traffic from other containers on the same network works without it.