Docker Compose Generator
Generate a docker-compose.yml with app, database and cache services.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Generated a Compose file with 3 service(s).
How it works
- Named the project "myapp" and declared the services mapping.
- Added: app, db, cache.
- Declared the named volume(s): db-data, app-data.
- Referenced passwords through environment variables rather than writing a value.
- Compose v2 no longer needs a top-level `version:` key, so none is emitted.
- Set the referenced environment variables before running `docker compose up`.
Methodology
- Emit the project name and the `services:` mapping.
- For each selected preset emit its image, restart policy, ports, environment references and volumes.
- Declare every referenced named volume under a top-level `volumes:` key.
Usage
- Name the project and decide whether to include the application service.
- Choose a database and a cache preset.
- Run the generator and copy or download the docker-compose.yml.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
App with Postgres and Redis
{
"projectName": "myapp",
"app": true,
"appImage": "ghcr.io/example/myapp:latest",
"appPort": 3000,
"database": "postgres",
"cache": "redis",
"volume": true
}Postgres only
{
"projectName": "database",
"app": false,
"appImage": "postgres:16-alpine",
"appPort": 5432,
"database": "postgres",
"cache": "none",
"volume": true
}Limitations
How the generated file handles configuration
The application service points at the database and cache by service name, which Compose resolves on its internal network. Passwords are always read from environment variables so the file is safe to commit.
The file is a starting point: add healthchecks, resource limits and production-specific networks as needed.
Frequently asked questions
- Why is there no `version:` key?
- The Compose specification deprecated the top-level `version` key. Modern Docker Compose reads the file without it, so the generator omits it.
- Are database passwords written into the file?
- No. The file references variables such as `${POSTGRES_PASSWORD}` that you set in your shell or an `.env` file, so no secret is committed.
Sources
- Compose specification — Docker
- Docker Compose overview — Docker
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.