A Nomad network block is a group-level configuration block that names ports and maps them to internal container ports. Every task in the group can use those named values. section 9.2.5
Map two application ports
Define named ports in the group, then reference each name from the matching task: Python uses "http-py" for container port 8080, while Node.js uses "http-js" for port 3000. The network block supplies the values; task configuration connects containers to them. section 9.2.5
Listing 9.10 Nomad job with network port mapping
job "web" {
group "apps" {
...
network {
port "http-py" {
to = 8080
}
port "http-js" {
to = 3000
}
}
}
}
Inspect the compact Nomad job fragment showing named ports and their internal container destinations. section 9.2.5
