### Complete Web Application Example Source: https://context7.com/score-spec/spec/llms.txt A comprehensive SCORE example for a web application, including container configuration, environment variables, file mounts, resource definitions, service ports, and health probes. ```yaml apiVersion: score.dev/v1b1 metadata: name: sample-webapp annotations: team.example.com/owner: platform-team monitoring.example.com/dashboard: webapp-metrics containers: main: image: ghcr.io/example/webapp:v2.1.0 command: ["/app/server"] args: ["--config", "/etc/app/config.yaml"] variables: NODE_ENV: production LOG_LEVEL: info PG_CONNECTION_STRING: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.database}?sslmode=require" REDIS_URL: "redis://${resources.cache.host}:${resources.cache.port}/0" PUBLIC_HOSTNAME: ${resources.dns.host} files: /etc/app/config.yaml: mode: "0644" content: | server: port: 8080 graceful_shutdown: 30s features: cache_enabled: true rate_limiting: true resources: requests: cpu: 250m memory: 256Mi limits: cpu: "1" memory: 1Gi livenessProbe: httpGet: port: 8080 path: /healthz readinessProbe: httpGet: port: 8080 path: /ready service: ports: web: port: 8080 metrics: port: 9090 resources: db: type: postgres metadata: annotations: backup.example.com/schedule: "0 2 * * *" cache: type: redis dns: type: dns route: type: route params: host: ${resources.dns.host} path: / port: 8080 ``` -------------------------------- ### Configure Liveness and Readiness Probes Source: https://context7.com/score-spec/spec/llms.txt Configure liveness and readiness probes for a container using HTTP GET requests or executing a command. Supports custom headers and schemes for HTTP probes. ```yaml apiVersion: score.dev/v1b1 metadata: name: monitored-service containers: api: image: api-server:latest livenessProbe: httpGet: port: 8080 path: /healthz scheme: HTTP exec: command: - /bin/health-check - --timeout=5s readinessProbe: httpGet: host: 127.0.0.1 port: 8080 path: /ready scheme: HTTP httpHeaders: - name: X-Health-Check value: readiness - name: Accept value: application/json service: ports: http: port: 8080 ``` -------------------------------- ### Metadata Configuration Source: https://context7.com/score-spec/spec/llms.txt Demonstrates how to define workload identity and custom annotations for organizational tracking. ```yaml apiVersion: score.dev/v1b1 metadata: name: user-service annotations: example.com/version: "2.0" example.com/team: platform monitoring.io/enabled: "true" containers: main: image: user-service:latest ``` -------------------------------- ### Container Files Configuration Source: https://context7.com/score-spec/spec/llms.txt Mounts files into containers using inline content, external source files, or base64-encoded binary data. ```yaml apiVersion: score.dev/v1b1 metadata: name: app-with-config containers: main: image: myapp:latest files: /etc/app/config.yaml: mode: "0644" content: | server: port: 8080 host: 0.0.0.0 database: url: ${resources.db.connection_string} /etc/app/secrets/tls.crt: source: ./certs/server.crt mode: "0400" /etc/app/binary-data: binaryContent: SGVsbG8gV29ybGQh noExpand: true resources: db: type: postgres ``` -------------------------------- ### Set Resource Requests and Limits for Containers Source: https://context7.com/score-spec/spec/llms.txt Specify CPU and memory resource requests (minimum required) and limits (maximum allowed) for containers. Units for CPU are cores/millicores, and for memory are bytes. ```yaml apiVersion: score.dev/v1b1 metadata: name: resource-constrained-app containers: worker: image: worker:latest resources: requests: cpu: 100m memory: 128Mi limits: cpu: 500m memory: 512Mi sidecar: image: log-collector:latest resources: requests: cpu: 50m memory: 64Mi limits: cpu: 100m memory: 128Mi ``` -------------------------------- ### Container Specification Source: https://context7.com/score-spec/spec/llms.txt Configures runtime parameters for a container, including commands, environment variables with resource references, and resource constraints. ```yaml apiVersion: score.dev/v1b1 metadata: name: api-server containers: api: image: ghcr.io/myorg/api-server:v1.2.3 command: ["/bin/server"] args: ["--port", "8080", "--config", "/etc/app/config.yaml"] variables: LOG_LEVEL: debug DATABASE_URL: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.database}" REDIS_URL: "redis://${resources.cache.host}:${resources.cache.port}" resources: requests: cpu: 250m memory: 256Mi limits: cpu: "1" memory: 1Gi resources: db: type: postgres cache: type: redis ``` -------------------------------- ### Declare Resource Dependencies with Parameters Source: https://context7.com/score-spec/spec/llms.txt Declare external resource dependencies like databases and caches, and reference their properties (host, port, credentials) within container environment variables. ```yaml apiVersion: score.dev/v1b1 metadata: name: full-stack-app containers: main: image: webapp:latest variables: DB_HOST: ${resources.database.host} DB_PORT: ${resources.database.port} DB_USER: ${resources.database.username} DB_PASS: ${resources.database.password} CACHE_URL: "redis://${resources.cache.host}:${resources.cache.port}" QUEUE_URL: ${resources.queue.url} PUBLIC_URL: "https://${resources.dns.host}" resources: database: type: postgres class: large metadata: annotations: backup.io/enabled: "true" params: extensions: - postgis - pg_trgm cache: type: redis id: shared-cache queue: type: rabbitmq dns: type: dns route: type: route params: host: ${resources.dns.host} path: / port: 8080 ``` -------------------------------- ### Sample Score Specification for a Web Server Source: https://github.com/score-spec/spec/blob/main/README.md This YAML defines a Score workload for a web server requiring a Postgres database and DNS. It specifies container image, environment variables, service ports, and resource dependencies. The PG_CONNECTION_STRING is parameterized to be resolved in the target environment. ```YAML # The version string helps identify the Score file syntax apiVersion: score.dev/v1b1 metadata: name: sample # A set of containers deployed together for this Workload. containers: main: # The "default" image for our service. When deploying, we may override this with a particular tag. image: ghcr.io/score-spec/sample-app-gif:sha-2533037 variables: # Pass the resource outputs to our container as environment variables. The Score implementation takes care of securing any secret access as needed. PG_CONNECTION_STRING: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.database}?sslmode=disable" # The service ports indicate which ports of the Workload are exposed for other services to call. service: ports: web: port: 8080 # Each resource dependency has a name and definition that helps the Score implementation link or provision the required resource. resources: db: # This database is specific to this Workload and not shared. type: postgres dns: # Ensure a dns name is available for request routing. type: dns route: # We want to ensure that requests on the Workload hostname go to our service port. type: route params: host: ${resources.dns.host} path: / port: 8080 ``` -------------------------------- ### Container Volumes Configuration Source: https://context7.com/score-spec/spec/llms.txt Mounts external storage resources into containers, supporting sub-paths and read-only access modes. ```yaml apiVersion: score.dev/v1b1 metadata: name: data-processor containers: processor: image: data-processor:latest volumes: /data/input: source: ${resources.input-storage.name} path: /incoming readOnly: true /data/output: source: ${resources.output-storage.name} path: /processed readOnly: false /cache: source: ${resources.cache-volume.name} resources: input-storage: type: volume output-storage: type: volume cache-volume: type: volume ``` -------------------------------- ### Signoff Commit Message Source: https://github.com/score-spec/spec/blob/main/CONTRIBUTING.md Include this line in your commit messages to verify authorship and rights. Ensure it matches your git user and email. ```bash This is my commit message Signed-off-by: Your Name ``` -------------------------------- ### Automatically Sign Commits with Git Source: https://github.com/score-spec/spec/blob/main/CONTRIBUTING.md Use the '-s' command line option with git commit to automatically append the DCO sign-off line to your commit messages. ```bash git commit -s -m 'This is my commit message' ``` -------------------------------- ### Basic Score Workload Specification Source: https://context7.com/score-spec/spec/llms.txt Defines the essential structure of a Score workload, including metadata, container images, service ports, and external resource dependencies. ```yaml # Basic Score workload specification structure apiVersion: score.dev/v1b1 metadata: name: my-web-app annotations: team.example.com/owner: backend-team containers: main: image: nginx:latest service: ports: web: port: 80 resources: cache: type: redis ``` -------------------------------- ### Define Multiple Service Ports Source: https://context7.com/score-spec/spec/llms.txt Define multiple network ports exposed by a workload, specifying port number, protocol (TCP/UDP), and internal target port. ```yaml apiVersion: score.dev/v1b1 metadata: name: multi-port-service containers: main: image: myapp:latest service: ports: http: port: 80 targetPort: 8080 protocol: TCP https: port: 443 targetPort: 8443 protocol: TCP metrics: port: 9090 protocol: TCP dns: port: 53 protocol: UDP ``` -------------------------------- ### Amend Commit with Signoff Source: https://github.com/score-spec/spec/blob/main/CONTRIBUTING.md If you forgot to sign off a commit and have not yet pushed it, use this command to amend the existing commit with the sign-off line. ```bash git commit --amend -s ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.