Configure Service Port Binding
mainBy default, traefik-kop picks up the service port from the container's port bindings if only one port is exposed.
Example (Auto-detection):
services:
nginx:
ports:
- 8088:80In this case, 8088 is automatically used as the service endpoint port.
Manual Configuration (Required for multiple ports or network_mode: host):
If you have multiple ports or are using host networking, you must explicitly tell Traefik which host-side port to connect to using the loadbalancer.server.port label.
Crucial Note: You must point Traefik to the host port (e.g., 8088), not the internal container port (e.g., 80), so that Traefik can reach the service over the network.
services:
nginx:
network_mode: host
ports:
- 8088:80
- 8888:81
labels:
- "traefik.http.services.nginx.loadbalancer.server.port=8088"