Docker Compose Environment Generator

devops
YAML
scaffolding
mentor
Remix

Generate a Docker Compose configuration for multi-service development environments with custom services and requirements.

12/8/2025

Prompt

Generate a Docker Compose configuration for the following development environment:

Project Overview

  • Project Type: [Web application / Microservices / Full-stack app / Data pipeline / Custom]
  • Primary Language/Framework: [Node.js / Python / Go / Java / Ruby / PHP / .NET / Multiple]
  • Development Team Size: [Solo / Small team / Large team]

Application Service

  • Service Name: [e.g., app, web, api, backend]
  • Base Image: [node:20-alpine / python:3.11 / golang:1.21 / custom]
  • Build Context: [. / ./backend / ./app / custom path]
  • Dockerfile: [Dockerfile.dev / Dockerfile / custom name]
  • Port Mapping: [e.g., 3000:3000, 8080:8080]
  • Hot Reload: [Yes with volume mounting / No]
  • Start Command: [npm run dev / python manage.py runserver / go run main.go / custom]

Database Services

Select required databases (can choose multiple):

Primary Database

  • Type: [PostgreSQL / MySQL / MongoDB / Redis / CouchDB / None]
  • Version: [Latest / Specific version]
  • Port: [Default / Custom port]
  • Initial Database Name: [Specify name]
  • Credentials: [user/pass or use defaults]
  • Initialization Scripts: [Yes, provide path / No]
  • Data Persistence: [Named volume / Bind mount / None]

Additional Databases

  • Secondary Database: [Redis for caching / Elasticsearch for search / None]
  • Version: [Latest / Specific]
  • Configuration: [Default / Custom config file]

Supporting Services

Select additional services needed:

Caching Layer

  • Service: [Redis / Memcached / None]
  • Configuration: [Default / Custom redis.conf]

Message Queue

  • Service: [RabbitMQ / Kafka / NATS / None]
  • Management UI: [Enable / Disable]

Reverse Proxy/Load Balancer

  • Service: [Nginx / Traefik / Caddy / HAProxy / None]
  • Configuration File: [Provide path or use default]
  • SSL/TLS: [Local certificates / None]

Monitoring & Logging

  • Logging: [Logstash / Fluentd / None]
  • Metrics: [Prometheus / Grafana / None]
  • Tracing: [Jaeger / Zipkin / None]

Service Dependencies

Define service startup order and dependencies:

  • [e.g., app depends on: db, redis]
  • [e.g., nginx depends on: app]
  • [List other dependencies]

Volume Configuration

  • Application Code: [Bind mount for hot reload / Copy to container]
  • Database Data: [Named volumes / Bind mounts]
  • Persistent Storage: [Additional volumes needed: [LIST] / None]
  • Exclude Patterns: [node_modules, pycache, .git, etc.]

Environment Variables

Define environment variables for each service:

App Service Variables

  • [e.g., NODE_ENV=development]
  • [e.g., DATABASE_URL=postgresql://user:pass@db:5432/dbname]
  • [e.g., REDIS_URL=redis://redis:6379]
  • [Add more as needed]

Database Variables

  • [e.g., POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB]
  • [Add others as needed]

Health Checks

  • Enable Health Checks: [Yes / No]
  • App Health Check: [HTTP endpoint / TCP check / Custom command]
  • Database Health Check: [pg_isready / mysqladmin ping / Custom]
  • Check Intervals: [Default / Custom timing]

Network Configuration

  • Network Setup: [Single default network / Multiple networks / Custom]
  • Network Isolation: [Frontend/Backend separation / All connected / Custom]
  • External Access: [Expose all services / Only app / Selective]

Development Features

  • Hot Reload: [Enabled with volume mounts / Disabled]
  • Debug Ports: [Expose debug ports: [SPECIFY] / No]
  • Test Environment: [Separate docker-compose.test.yml / Integrated / None]
  • Seed Data: [Initialize with seed data / Empty start]

Resource Limits

  • Memory Limits: [Set limits per service / Unlimited]
  • CPU Limits: [Set limits / Unlimited]
  • Storage Limits: [Set quotas / Unlimited]

Additional Configuration

  • Docker Compose Version: [3.8 / 3.9 / Latest]
  • Override Files: [docker-compose.override.yml / docker-compose.prod.yml / Custom]
  • Profiles: [Use profiles for optional services / No]

Platform-Specific Requirements

  • Target OS: [Linux / macOS / Windows / Cross-platform]
  • Architecture: [amd64 / arm64 / Both]

Generate a complete Docker Compose setup including:

  • Main docker-compose.yml file with all services configured
  • Dockerfile.dev (or appropriate Dockerfile) for application service
  • Volume definitions for data persistence
  • Network configuration
  • Environment variable setup
  • Health checks for services
  • Service dependencies with depends_on
  • Port mappings for all services
  • README with common commands:
    • Start services: docker-compose up
    • Start in background: docker-compose up -d
    • View logs: docker-compose logs -f [service]
    • Stop services: docker-compose down
    • Rebuild: docker-compose up --build
    • Execute commands: docker-compose exec [service] [command]
  • Optional override file for testing (docker-compose.test.yml) if testing environment is needed

Output production-ready configuration optimized for development workflow with fast startup times and proper isolation.

Tags

docker
docker-compose
containers
development

Tested Models

gpt-4
claude-3-5-sonnet

Comments (0)

Sign in to leave a comment

Sign In