Port Mapping¶
PeiDocker treats port mappings as Docker Compose strings and preserves them without trying to parse them into numeric models.
Where To Put Ports¶
stage_1.portsfor system servicesstage_2.portsfor application servicesstage_1.ssh.host_portfor SSH specifically
Formats¶
Supported examples:
8080:803000-3002:3000-3002127.0.0.1:8080:80{{WEB_HOST_PORT:-18080}}:80
Stage-2 receives stage-1 port mappings plus its own additional mappings.
Example¶
stage_1:
ports:
- "6006:6006"
stage_2:
ports:
- "8080:80"
- "3000-3002:3000-3002"
Notes¶
- SSH host port mapping is added automatically when
stage_1.ssh.host_portis set. - Because the values stay string-shaped, passthrough markers work cleanly in port mappings.
See 06 Port Mapping.