Context
From PR #109 review.
pickPrimaryService returns the first service with ports/expose in multi-service compose files. In Go maps, iteration order is random, so the selected service may not be the intended primary.
Location
internal/docker/discovery.go — pickPrimaryService()
Suggested improvement
Prioritize services named app or web before falling back to the first with ports:
for name, svc := range services {
if (name == "app" || name == "web") && (len(svc.Ports) > 0 || len(svc.Expose) > 0) {
return name, svc
}
}
for name, svc := range services {
if len(svc.Ports) > 0 || len(svc.Expose) > 0 {
return name, svc
}
}