version: "3.9"

services:
  athena:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "4052:4052"
    env_file:
      - .env
    environment:
      RUST_LOG: "${RUST_LOG:-info}"
      # Optional caching can point to Redis via ATHENA_REDIS_URL.
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://localhost:4052/"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s
    # Athena never depends_on Redis so the API starts even when Redis is absent.

  redis:
    image: redis:8.2.4-alpine3.22
    ports:
      - "6379:6379"
    restart: unless-stopped
    volumes:
      - redis-data:/data
    command: ["redis-server", "--save", "", "--appendonly", "no"]

volumes:
  redis-data:
