Compose audit
Check a Docker Compose project's published ports against what actually listens on the host.
Usage
portop --compose ~/stacks/shop portop --compose ~/stacks/shop --json
Files and variables
portop reads the files Docker Compose would load: the first of compose.yaml, compose.yml, docker-compose.yml and docker-compose.yaml, plus the first override found. ${VARIABLE}, ${VARIABLE:-default} and the other Compose forms are substituted from the .env file next to them and the environment, which wins.
Statuses
| Status | Meaning |
|---|---|
expected | The port is held by the matching service or container |
conflict | Something else listens on it |
unused | Nothing listens on it |
dynamic | Compose picks the host port at runtime |
The command exits 3 when a port is unused or in conflict. With access to Docker, portop reads Docker's published-port table and Compose labels, so a docker-proxy listener is tied back to its service.