Section: Ports and Networks

Resolve published port

bash
bash
docker compose port web 80
Explanation

Useful when ports were assigned dynamically.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Ports and Networks
Publish container port
Maps host port 8080 to container port 80.
OpenIn sheetyamlsame section
Bind only on localhost
Publishes the service only to the local machine.
OpenIn sheetyamlsame section
Attach services to custom network
Defines multiple named networks for segmentation.
OpenIn sheetyamlsame section
Set network aliases
Adds alternate DNS names for a service on a network.
OpenIn sheetyamlsame section
Named volume for persistent data
Stores database data in a managed named volume.
OpenIn sheetyaml2 tag match
Mount a secret file
Mounts a file-backed secret into the container.
OpenIn sheetyaml2 tag match