Docker compose generator

Pick services, set ports/volumes/environment, and export a ready docker-compose.yml. Includes smart service recommendations.

Services

AI recommendation: consider adding redis, nginx.

node configuration

postgres configuration

Need more than a template?

Want a hand with the infrastructure side?

I set up CI/CD, Kubernetes and cloud platforms that keep releases routine.

DevOps engineering →

How to use the Docker Compose generator

Choose the services your project needs and the tool writes a docker-compose.yml with images, ports, volumes and environment variables filled in. There are 21 services to pick from, from PostgreSQL, MySQL, MongoDB and Redis to Kafka, Grafana, Prometheus and Traefik. Every field can be edited before you copy or download the file.

  1. Select the services. If you pick one that usually needs a companion, such as Kafka without ZooKeeper, the tool suggests adding it.
  2. Edit the image tag, ports, volumes and environment variables for each service.
  3. Copy or download the YAML, review it, and run docker compose up.

Worked examples

PostgreSQL and Redis

services:
  postgres:
    image: postgres:16
    ports:
      - '5432:5432'
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: app
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
  redis:
    image: redis:7
    ports:
      - '6379:6379'
    volumes:
      - redis_data:/data
    command: redis-server --appendonly yes
volumes:
  postgres_data: null
  redis_data: null

This is the tool's own output for those two services, untouched.

Mistakes to avoid

  • Shipping the default passwords

    The defaults, such as POSTGRES_PASSWORD: postgres, are there to get you running locally. Change them before the file goes near a shared or public machine.

  • Publishing database ports to every interface

    '5432:5432' exposes the port on all network interfaces of the host. For local work bind it to the loopback address with '127.0.0.1:5432:5432'.

  • Leaving the version line in

    Docker Compose v2 ignores the top-level version key and prints a warning about it. Delete the first line.

  • Assuming depends_on waits for readiness

    It only controls start order. If a service needs the database to accept connections, add a healthcheck and use depends_on with condition: service_healthy.

  • Using latest tags

    A few of the services (Adminer and MailHog, for example) default to latest. Pin an exact version so a rebuild next month does not change your stack.

Questions people ask

Is the generated file ready for production?
It is a good starting point for development and testing. For production you will want pinned versions, real secrets, resource limits, healthchecks and a decision about where the data lives.
Can I use my own image?
Yes. Replace the image field on any service, or use the node and nginx entries as a base and edit them.

Related