networks:
  1panel-network:
    external: true
services:
  ollama:
    container_name: ollama
    devices:
    - /dev/dri:/dev/dri
    env_file:
    - ./envs/global.env
    - .env
    environment:
    - TZ=Asia/Shanghai
    - OLLAMA_HOST=0.0.0.0
    - OLLAMA_PORT=11434
    - OLLAMA_MAX_LOADED_MODELS=1
    - OLLAMA_NUM_PARALLEL=1
    - OLLAMA_MAX_QUEUE=512
    - OLLAMA_FLASH_ATTENTION=0
    - OLLAMA_KV_CACHE_TYPE=f16
    image: ollama/ollama:0.12.7
    labels:
      createdBy: Apps
    networks:
    - 1panel-network
    ports:
    - ${PANEL_APP_PORT_HTTP}:11434
    restart: always
    tty: true
    volumes:
    - ${OLLAMA_ROOT_PATH}/data:/root/.ollama
