Skip to main content

compose

translate a docker-compose file into a computesphere.yaml manifest

📦 Translate a docker-compose file into a computesphere.yaml manifest.

import compose reads a docker-compose file and writes the equivalent ComputeSphere version-2 manifest. It runs entirely on your machine — it never calls the API and never deploys anything — so you can review the result before running csph apply.

How compose maps to ComputeSphere:

• A service with ports: becomes a web-service (the container/target port is used); a service without ports becomes a background-worker. • A database, cache or queue image (postgres, mysql, mariadb, mongo, redis, valkey, rabbitmq) is imported as a plain container, with a warning: its data is lost on every redeploy unless it's on a volume, so a database you run elsewhere is usually the better fit. • build: sets build_source: git (connect a repo before deploying). • deploy.replicas becomes spherelets. • environment: becomes env_vars. Keys that look like secrets (*_KEY, *_TOKEN, *_SECRET, *_PASSWORD, …) become secret_vars placeholders — the literal value is dropped and must be set out of band. • An env value that points at another app service — http://api:8000, api:8000, or just the bare service name — is rewritten to a fromService reference to that service's internal_url (its private address inside the environment), wired in at deploy time. A value that points at a database container or a background worker, names only a host or port (*_HOST, *_PORT), or embeds a service name inside hand-built credentials, is left untouched and flagged for review.

Unsupported compose fields (volumes, networks, healthcheck, …) are never silently dropped — every one is reported as a warning. The translated manifest goes to --output (default computesphere.yaml in the current directory; use -o - for stdout); the summary and warnings always go to stderr. An existing output file is never overwritten unless you pass --force.

This command supports reading input from a file. Files can be supplied via the --file flag or piped into the command.

Example of file structure
{}

Usage​

csph import compose [flags]

Options​

Command Specific​

-f, --file <string>

docker-compose file to import (default: compose.yaml)
--force
overwrite the output file if it already exists

-o, --output <string> (default "computesphere.yaml")

manifest output path; use - for stdout

Inherited​

--config <string>
config file (default is $HOME/.config/computesphere/configuration.yaml)
--debug
enable debug logging

-h, --help

show this help message

-i, --interactive

run interactively (prompts, pickers, table browser)
--log-level <string>
log level: [trace|debug|info|warn|error|fatal|panic|disabled||api]
--no-color
disable color output
--no-input
disable interactive mode

Examples​

# translate ./compose.yaml into ./computesphere.yaml
> csph import compose

# read a specific file and print the manifest to stdout
> csph import compose -f docker-compose.yaml -o -

# re-import, overwriting an existing computesphere.yaml
> csph import compose --force

# translate, then apply it
> csph import compose -f compose.yaml
> csph apply -f computesphere.yaml

See also​

  • csph import — import external config into a computesphere.yaml manifest