services:
  tiles:
    image: eqalpha/keydb:latest
    volumes:
      - tiles-data:/data
    ports:
      - "6379:6379"
    command: keydb-server /etc/keydb/keydb.conf --maxmemory 100mb --maxmemory-policy volatile-lru --maxmemory-samples 5
    restart: unless-stopped
  keydb:
    image: eqalpha/keydb:latest
    volumes:
      - keydb-data:/data
    ports:
      - "6380:6379"

    restart: unless-stopped
  storage:
    image: "ghcr.io/marcopedone/go_fs:latest"
    ports:
      - "8080:8080"
    environment:
      PORT: 8080
      AUTH_TOKEN: ${STORAGE_TOKEN}
    pull_policy: "always"
    volumes:
      - storage_data:/app/storage
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 10s
  browserless:
    image: browserless/chrome:latest
    ports:
      - "8081:3000" # Optional: Access the debug dashboard at localhost:8080
    environment:
      - MAX_CONCURRENT_SESSIONS=5
      - CONNECTION_TIMEOUT=30000
    restart: always

volumes:
  tiles-data:
  keydb-data:
  storage_data:
