All tools / Containers
Compose port and volume map
Explain Compose port publishes and volume mounts: host versus container, protocol, and bind versus named volume.
Reading
Plain text
Short syntax
| Mapping | Meaning |
|---|---|
8080:80 | Host port 8080 to container port 80, TCP, every interface |
127.0.0.1:8443:443/tcp | Same, bound to loopback |
80 | Container port 80 on an ephemeral host port |
./data:/var/lib/app:ro | Bind mount, read-only in the container |
pgdata:/var/lib/postgresql/data | Named volume. A source without a slash is not a relative path |