Score · Example Payload

Score Compose Output Example

Example Docker Compose output generated by score-compose from a Score specification

Platform EngineeringCloud NativeCNCFWorkload SpecificationKubernetesDockerDeveloper ExperienceOpen Source

Score Compose Output Example is an example object payload from Score, with 4 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

descriptioncommandformatcontent

Example Payload

score-compose-output-example.json Raw ↑
{
  "description": "Example Docker Compose output generated by score-compose from a Score specification",
  "command": "score-compose generate -f score.yaml -o compose.yml",
  "format": "yaml",
  "content": {
    "services": {
      "hello-world-service": {
        "image": "nginx:1.25",
        "environment": {
          "APP_PORT": "8080",
          "DATABASE_URL": "postgresql://user:password@db:5432/hello_world",
          "REDIS_URL": "redis://cache:6379",
          "LOG_LEVEL": "info"
        },
        "ports": [
          "80:8080",
          "9090:9090"
        ],
        "volumes": [
          "./data:/data"
        ],
        "depends_on": {
          "db": {"condition": "service_healthy"},
          "cache": {"condition": "service_started"}
        },
        "healthcheck": {
          "test": ["CMD", "curl", "-f", "http://localhost:8080/health"],
          "interval": "30s",
          "timeout": "10s",
          "retries": 3
        },
        "deploy": {
          "resources": {
            "limits": {
              "memory": "256m",
              "cpus": "0.5"
            }
          }
        }
      },
      "db": {
        "image": "postgres:15",
        "environment": {
          "POSTGRES_DB": "hello_world",
          "POSTGRES_USER": "user",
          "POSTGRES_PASSWORD": "password"
        },
        "healthcheck": {
          "test": ["CMD-SHELL", "pg_isready -U user"],
          "interval": "10s",
          "timeout": "5s",
          "retries": 5
        }
      },
      "cache": {
        "image": "redis:7-alpine"
      }
    },
    "volumes": {
      "data": {}
    }
  }
}