Specify domain with port/ingress definition
At the moment we specify domains with the domainname field in a service definition.
I would prefer to specify the domain in the port list. Something along the lines of:
services:
web:
# [...]
ports:
- target: 3000
mode: ingress
host: mydomain.com
While less common, this provides the ability to specify multiple domains for a service (i.e. with an admin endpoint and a public endpoint):
services:
twoEndpointService:
# [...]
ports:
# public endpoint
- target: 3000
mode: ingress
host: mydomain.com
# public endpoint
- target: 3003
mode: ingress
host: admin.mydomain.com
I think it also just feels more appropriate to define the domain along with the port. They're intrinsically tied together, so their configuration should reflect that.
The spec has no such option though: https://github.com/compose-spec/compose-spec/blob/master/05-services.md#long-syntax-3
The spec has no such option though: https://github.com/compose-spec/compose-spec/blob/master/05-services.md#long-syntax-3
@edwardrf said he could find a way to make it happen 😁
I'm guessing it would look more like:
services:
twoEndpointService:
# [...]
ports:
# public endpoint
- target: 3000
mode: ingress
x-host: mydomain.com
# public endpoint
- target: 3003
mode: ingress
x-host: admin.mydomain.com