services:
  localai:
    image: localai/localai:v3.12.1-aio-cpu
    container_name: ${CONTAINER_NAME}
    # For Nvidia GPUs decomment one of the following (cuda11 or cuda12):
    # image: localai/localai:v2.25.0-aio-gpu-nvidia-cuda-11
    # image: localai/localai:v2.25.0-aio-gpu-nvidia-cuda-12
    # Decomment the following piece if running with Nvidia GPUs
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: 1
    #           capabilities: [gpu]
    restart: always
    networks:
      - 1panel-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:8080
    environment:
      - DEBUG=true
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"]
      interval: 1m
      timeout: 20m
      retries: 5
    volumes:
      - ./data:/build/models:cached
    labels:
      createdBy: "Apps"
networks:
  1panel-network:
    external: true
