Job Type: Docker-Compose

March 14, 2022 ยท View on GitHub

Sometimes you want to start multiple containers to test your application. For this InfraBox supports also docker-compose. You can specify a docker-compose.yml and InfraBox will start it as one job.

{
    "version": 1,
    "jobs": [{
        "type": "docker-compose",
        "name": "test",
        "enable_docker_build_kit": true,
        "docker_compose_file": "infrabox/test/docker-compose.yml",
        "resources": { "limits": { "cpu": 1, "memory": 1024 } },
        "cache": { ... },
        "timeout": 3600,
        "depends_on": ["other_job_name"],
        "environment": { ... }
    }]
}
NameRequiredTypeDefaultDescription
typetruestringHas to be "docker-compose" to run multiple containers
nametruestringName of the job
enable_docker_build_kitfalsebooleanfalseIf set to true, InfraBox will try to use the Dokcer Buildkit to build the containers. For more details, please refer to Docker docs
docker_compose_filetruestringPath to the docker-compose.yml
resourcestrueResource ConfigurationSpecify the required resources for your job
cachefalseCache Configuration{}Configure the caching behavior
timeoutfalseinteger3600Timeout in seconds after which the job should be killed. Timeout starts when the job is set to running
depends_onfalseDependency Configuration[]Jobs may have dependencies. You can list all jobs which should finish before the current job may be executed.
environmentfalseEnvironment Variables{}Can be used to set environment variables for the job.

Sharing files between containers

InfraBox automatically mounts a shared volume into all containers at /infrabox/shared. You may use it to exchange data between your containers.