# Docker Compose Defaults - Docker Compose deployment configuration
# Version: 1.0.0
#
# Scenario: Docker Compose specific defaults and best practices
# Use case: Local development, testing, small deployments

{
  docker_compose_defaults = {
    deployment = {
      target = 'docker,
      docker_compose = {
        enabled = true,
        version = '3.8,
        env_file = ".env",
        profiles = [],
      },
    },

    # Common Docker Compose network setup
    network = {
      docker_networks = {
        frontend = {
          name = "frontend-network",
          driver = 'bridge,
          internal = false,
          attachable = true,
        },
        backend = {
          name = "backend-network",
          driver = 'bridge,
          internal = true,
          attachable = false,
        },
      },
    },

    # Common Docker Compose volume setup
    storage = {
      docker_volumes = {
        data = {
          name = "app-data",
          driver = 'local,
          external = false,
          labels = {
            "com.docker.compose.project" = "app",
          },
        },
        logs = {
          name = "app-logs",
          driver = 'local,
          external = false,
          labels = {
            "com.docker.compose.project" = "app",
          },
        },
      },
    },

    # Service template with common Docker Compose settings
    service_template = {
      restart_policy = 'unless-stopped,
      healthcheck = {
        enabled = true,
        interval = 30,
        timeout = 10,
        retries = 3,
        start_period = 10,
      },
      labels = {
        "com.docker.compose.service" = "app",
      },
    },
  },
}
