Docker Compose Generator

Build docker-compose.yml visually — add services, configure, and copy.

Presets:

Services

Service 1
services:

What It Does

Presets

Compose File Structure

Best Practices

Frequently Asked Questions

What version of docker-compose.yml syntax does the generator produce?
The generator produces Compose Specification syntax (version "3.8" or later), which is compatible with Docker Compose v2 (the docker compose plugin) and Docker Desktop. The older version 2.x syntax is largely compatible but lacks features like deploy constraints and secrets.
How do I make one service wait for another to be ready?
Use the depends_on option with a condition. For example, depends_on: db: condition: service_healthy combined with a healthcheck on the db service. Without a condition, depends_on only waits for the container to start, not for the application inside it to be ready.
What is the difference between ports and expose in docker-compose?
ports maps a container port to a host port (e.g., "8080:80"), making it accessible from outside Docker. expose makes a port available to other services on the same Docker network but does NOT publish it to the host — it's internal only and primarily for documentation.
How do I persist data across container restarts using volumes?
Define a named volume in the top-level volumes section and mount it in your service under volumes. For example, volumes: - db-data:/var/lib/mysql. Named volumes persist even when containers are removed (docker compose down). Use docker compose down -v to also remove volumes.
Can I use environment variables in docker-compose.yml itself?
Yes. Docker Compose supports variable substitution using ${VARIABLE} syntax in the YAML file. Values are read from a .env file in the same directory, from shell environment variables, or from an env_file directive on the service. This keeps secrets out of the compose file itself.