Skip to main content

Docker Compose

Komodo can deploy Docker Compose projects through the Stack resource.

Configuration

[[stack]]
name = "my-stack"
[stack.config]
server = "server-prod"
run_directory = "/opt/stacks/my-stack"
file_paths = ["compose.yaml"]
git_account = "my-user"
repo = "myorg/stacks"
environment = """
DB_HOST = db.example.com
LOG_LEVEL = info
"""

Config fields

FieldDescriptionDefault
serverThe Server to deploy on.
file_pathsList of compose files. Supports composing multiple files via docker compose -f ... -f ....[]
run_directoryWorking directory for compose commands.
project_nameOverride the compose project name. Defaults to the Stack name.Stack name
environmentEnvironment variables written to a .env file and passed via --env-file. Supports variable interpolation.""
extra_argsAdditional flags passed to docker compose up.""
ignore_servicesServices to exclude from health checks (e.g. init containers that exit after startup).[]
git_providerGit provider domain.github.com
git_accountGit provider account for private repos.
repoRepository in owner/repo format.
branchBranch to clone.main
auto_updateAutomatically redeploy when newer image digests are available.false
poll_for_updatesCheck for newer images and show an update indicator.false
send_alertsSend alerts on stack state changes.true
linksQuick links displayed in the resource header.[]

Defining Compose Files

Stacks support three ways to provide compose files:

  1. Write in the UI — Komodo writes the files to the host at deploy time.
  2. Files on the host — Point to existing files on the server.
  3. Git repo — Komodo clones the repo onto the host to deploy. Changes are tracked in git and you can use webhooks to auto-redeploy on push.

Importing Existing Projects

To import a running compose project, create a Stack in Komodo with access to the same compose files and attach the correct Server. Komodo matches projects by compose project name — if the running project name differs from the Stack name, set a custom project_name in the config. Run docker compose ls on the host to find existing project names.

Deploying to a Swarm

A Stack can target a Swarm instead of a single Server to deploy via docker stack deploy. See Swarm for details.