Compose version:
Service 1
docker-compose.yml
Generate docker-compose.yml files visually
Define services, ports, volumes, environment variables, and dependencies through a form and get a valid docker-compose.yml instantly. No YAML indentation errors, no memorizing the compose spec.
Frequently Asked Questions
- What is docker-compose used for?
- Compose describes multi-container applications in one YAML file, so a full stack (app, database, cache) starts with a single docker compose up command.
- What is the difference between ports and expose?
- ports publishes a container port to the host (8080:80), while expose only documents that a port is used for inter-container traffic without binding it to the host.
- How do volumes work in compose?
- Volumes persist data beyond container restarts. Named volumes (db-data:/var/lib/postgresql/data) are managed by Docker; bind mounts (./src:/app) map host directories for live development.
- Do I still need a version key in docker-compose.yml?
- No — the version field is obsolete in the modern Compose specification and Docker ignores it. Current files simply start with services:.