Specification
In most cases, useenvironment/docker-compose.yaml to specify the multi-container environment.
Harbor itself is agnostic to which infra-as-code spec you use, which means it is possible to support multi-container environments using something other than
docker-compose.yaml. We have not implemented support for anything else natively, but users are free to do so by implementing a custom environment.Reserved services and default compose
Harbor reserves themain service name for the agent container. All other services are treated as sidecars. Harbor merges your environment/docker-compose.yaml on top of a base compose file, so you do not need to define the main service build or keepalive command yourself.
For tasks with a Dockerfile, the base compose is docker-compose-build.yaml:
src/harbor/environments/docker/docker-compose-build.yaml
docker-compose-prebuilt.yaml:
src/harbor/environments/docker/docker-compose-prebuilt.yaml
Example Layout
main. In compose you typically only add overrides such as depends_on and healthchecks; Harbor wires the rest.
environment/docker-compose.yaml
main; reach them by service name (e.g. http://mcp-server:8000).

