Boneyard Tools

Docker Compose Generator

Define your services, ports, environment variables and volumes, then get a clean docker-compose.yml that builds as you type. Use the presets for common databases and copy or download the result.

How to generate a docker-compose.yml

  1. Add a service and give it a name, then set an image or pick a backing-service preset.
  2. Fill in ports, environment variables, volumes and any services it depends on.
  3. Copy the generated YAML or download it as docker-compose.yml in your project root.

Examples

Web app with a Postgres database

services: web (nginx:alpine, port 8080:80, depends on db) + db (postgres preset)
services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
    depends_on:
      - db
    restart: unless-stopped
  db:
    image: postgres:16
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: app
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: unless-stopped
volumes:
  pgdata: {}

Frequently asked questions

Is my configuration sent to a server?

No. The file is generated entirely in your browser from the services you define, so nothing you type is uploaded anywhere.

Why is there no version key at the top of the file?

The modern Compose specification no longer needs a top-level version key, and recent Docker Compose ignores it. The generator omits it by default to match the current spec.

What do the database presets give me?

Each preset fills in a sensible image, the default published port, starter environment variables and a named volume for data. Postgres, MySQL, Redis, MongoDB and Nginx are included, and you can edit any field afterwards.

How do I make one service wait for another?

Add the other service name to the depends on field. Compose then starts the dependency first. Note that depends on waits for the container to start, not for the service inside it to be fully ready.

What is the difference between a named volume and a bind mount?

A mount like pgdata:/var/lib uses a named volume that Docker manages, and the generator declares it under a top-level volumes block. A mount that starts with ./ or / is a bind mount to a host path and is left as is.

Will the output always be valid YAML?

Yes. The file is serialized from a structured object with a YAML library, so indentation and quoting are handled for you and the result parses cleanly.

Related tools