Docker Compose generator

Build a docker-compose.yml for your app and the services it needs. Databases come with health checks, volumes and connection URLs already wired in.

Generate your files

What you get

Sample output

docker-compose.yml
services:
  app:
    build: .
    ports:
      - "3000:3000"
    environment:
      DATABASE_URL: "postgres://app:${DB_PASSWORD:?set DB_PASSWORD in .env}@postgres:5432/app"
      REDIS_URL: "redis://:${REDIS_PASSWORD:?set REDIS_PASSWORD in .env}@redis:6379"
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy
    restart: unless-stopped
  postgres:
    image: postgres:17-alpine
    environment:
      POSTGRES_USER: "app"
      POSTGRES_PASSWORD: "${DB_PASSWORD:?set DB_PASSWORD in .env}"
      POSTGRES_DB: "app"
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL","pg_isready -U app -d app"]
      interval: 5s
      timeout: 5s
      retries: 10
    restart: unless-stopped
  redis:
    image: redis:7-alpine
    command: ["redis-server","--requirepass","${REDIS_PASSWORD:?set REDIS_PASSWORD in .env}"]
    environment:
      REDISCLI_AUTH: "${REDIS_PASSWORD:?set REDIS_PASSWORD in .env}"
    volumes:
      - redis-data:/data
    healthcheck:
      test: ["CMD-SHELL","redis-cli ping | grep -q PONG"]
      interval: 5s
      timeout: 5s
      retries: 10
    restart: unless-stopped

volumes:
  postgres-data:
  redis-data:
docker-compose.yml for a Node.js app with Postgres and Redis. Generated by Dockcrate.

How it works

  1. Pick a stack and the options you need.
  2. Preview every file, and edit or switch off any block.
  3. Copy the files or download them as a zip.

Questions

Which databases and services can I add?

Postgres, MySQL, MariaDB, MongoDB, Redis, Memcached, Elasticsearch, RabbitMQ and Mailpit. MySQL and MariaDB cannot be combined because both use port 3306.

Can one compose file run several of my apps?

Yes. Split the project into services, each with its own folder and stack, and the output is one compose file with one Dockerfile per service.

How do I keep dev and production apart?

Add environments. Each one gets a compose override file, and dev also gets a Dockerfile.dev that mounts your source.

Are the passwords safe to commit?

The compose file reads them from the environment and falls back to a development default. Put real values in your own .env file; .env.example only shows the names.