docker compose port --index 2 web 80

Category: Docker

docker compose port --index 2 web 80

Show the published port of a specific replica

Resolves the host port mapped to container port 80 for the second replica of web, accounting for random host ports. --index picks the replica; --protocol selects tcp or udp. Useful when ports are assigned dynamically.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.