# Compose Specification shape: no top-level `version:` key, which the spec deprecated and modern
# Compose warns about. A parser written against the older schema often *requires* it, so this
# fixture is the one that separates the two generations of tooling.
name: orders-stack

services:
  api:
    image: registry.example.invalid/example-org/orders:1.4.0
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      LOG_LEVEL: info
      CACHE_URL: redis-compatible://cache:6379
    depends_on:
      cache:
        condition: service_healthy
      migrate:
        condition: service_completed_successfully
    healthcheck:
      test: ["CMD", "example-healthcheck", "--port", "8080"]
      interval: 10s
      timeout: 2s
      retries: 3
      start_period: 20s
    networks:
      - backend
    deploy:
      resources:
        limits:
          cpus: "0.50"
          memory: 512M

  cache:
    image: registry.example.invalid/example-org/cache:2.1.0
    healthcheck:
      test: ["CMD", "example-ping"]
      interval: 5s
      retries: 5
    volumes:
      - cache-data:/data
    networks:
      - backend

  migrate:
    image: registry.example.invalid/example-org/orders:1.4.0
    command: ["migrate", "--to", "latest"]
    restart: "no"
    networks:
      - backend

networks:
  backend:
    driver: bridge

volumes:
  cache-data: {}
