Overview
Using the CLI, you can deploy docker-compose resources directly to Control Plane.Prerequisites
- Permissions to push an image
- Permissions to create a workload, volumeset, secret, identity
- Install the CLI
- A docker-compose project
Deploy project
Refer to the stack deploy command for details and examples on how to deploy from a docker-compose project.Delete project
Refer to the stack rm command for details and examples on how to delete resources generated by a docker-compose project.Generate Control Plane Spec
You can generate a Control Plane spec without deploying the resources. Refer to the stack manifest command for details and examples on how to generate a Control Plane spec from a docker-compose project.Override Workload Spec with x-cpln
The CLI looks for an x-cpln block on each compose service. The keys inside this block are merged over the inferred Control Plane workload spec before deployment or when you run cpln stack manifest, letting you control fields that are not expressible in plain docker-compose (for example firewall rules, identities, retry policies, or autoscaling).
cpln stack manifest with the compose file above produces a workload spec that includes the overrides:
Requirements
- Service-to-service connections must use the CPLN local syntax for host name.
- Workload name would be the service name in this case.
- E.g., if service1 connects to service2 to using
http://service2:8080, this must be replaced withhttp://service2.{GVC}.cpln.local:8080
- Docker Compose file must specify all ports to be exposed, even just internally exposed ports.
Translation Notes
- Compose services become single container workloads
- Compose networks are used to configure the internal firewall of the workload
- Compose volumes are converted to volumesets, with 10gb storage
- Compose secrets, configs, and file bind mounts are converted to secrets. Necessary policies and identities will be created.
- All external outbound requests are enabled by default, unless
network_modeis set tonone deploy.resource.limit.cpusanddeploy.resource.limit.memorywill determine cpu and memory allocation respectively.- Default cpu and memory (if above not specified) set to 42m and 128Mi respectively
- Include an
x-cplnsection on a service to override or extend the generated workload spec (for example, to set a customfirewallConfig). - Environment variables determined from
environmentfield and/orenv_file portsandexposefield maps to container ports- Note: We only use the container port, not host port. Other services MUST connect to the container port.
- Capacity AI will be enabled if
deploy.resources.reservations<deploy.resources.limits deploy.replicaswill determine replica count (min AND max)healthcheckvalues will map to readiness probe- Services with a GPU device will have GPU enabled.
- Note: cpu and memory values may have to be increased if GPU is enabled.