The Harbor Compose file is a YAML file defining shipments, containers, and environment variables. The default path for a Harbor Compose file is ./harbor-compose.yml.
This section contains a list of all configuration options supported by Harbor Compose.
There is currently only 1 version available.
This defines a list of one or more shipments that are part of your application.
harbor-compose up will then bring up all of the shipments listed here.
version: "1"
shipments:
shipment1:
...
shipment2:
... This defines which environment your shipment will run in (e.g; dev, qa, prod, etc.). Must be a string.
This defines which managed cluster your shipment will run on. Must be a string that matches one of our supported clusters.
Note that you must run harbor-compose down when changing this value.
Add environment variables at the shipment/environment level. This must be a dictionary. Any boolean values; true, false, yes no, need to be enclosed in quotes to ensure they are not converted to True or False by the YML parser.
Note that these environment variables get injected into all containers that are associated with the shipment.
environment:
RACK_ENV: development
SHOW: "true"This is a list of containers that are part of the shipment. It is an array of string values that must be a valid service that exists in the docker-compose.yml file.
This also means that you can have containers in your docker-compose.yml that get started when you dev locally, but are not referenced in your harbor-compose.yml, and therefore, not deployed to Harbor.
For example if you have a docker-compose.yml like...
version: "2"
services:
service1:
...
service2:
... Then your harbor-compose.yml could be:
my-shipment:
containers:
- service1
- service2
... but the following would be invalid:
my-shipment:
containers:
- some-other-service
... This value defines how many instances of your container will be run behind a load balancer. Must be a positive integer. Note that the value applies to all containers in a shipment. If you want to scale your set of containers differently, you can move them onto different shipments.
replicas: 2This value defines which customer group your shipment belongs to. The group determines who can access your shipment. It must be a valid group that is defined in Harbor.
group: mssThis value defines which property your shipment serves.
property: cnnThis value defines which project your shipment is a part of.
project: expansionThis value defines your shipment as a product.
product: mss-my-app-webThe following options are currently supported by Harbor Compose. Note that you are free to use all of the Docker Compose options when working with Docker Compose, however, only the following options are used by Harbor Compose.
Can be used to build images locally (docker-compose build) that can be pushed (docker-compose push) and run on Harbor.
build: .These environment variables get injected into your container. Any values here will override values that are also specified in harbor-compose.yml.
environment:
RACK_ENV: development
SHOW: "true"The tagged Docker image that is deployed to Harbor.
image: registry.services.dmtio.net/my-web-app:1.0.0The docker exposed ports (HOST:CONTAINER) will be mapped to the (FRONT-END:BACK-END) ports on the load balancer. Note the currently only a single Harbor port is supported.
ports:
- "80:5000"