# named volume 'ollama' is marked as "external" (used by service 'ollama'), so either remove "external" from volume definition or it needs to be created using: docker volume create ollama
name: ollama
services:
  ollama:
    devices:
      - /dev/kfd
      - /dev/dri
    volumes:
      - ollama:/root/.ollama
      - /home/andy/.lmstudio/models:/models 
    ports:
      - 11434:11434
    container_name: ollama
    restart: unless-stopped
    image: ollama/ollama:rocm

  open-webui:
    depends_on:
      - ollama
    ports:
      - ${OPEN_WEBUI_PORT-3001}:8080
    extra_hosts:
      - host.docker.internal:host-gateway   
    volumes:
      - open-webui:/app/backend/data
    container_name: open-webui
    restart: unless-stopped
    image: ghcr.io/open-webui/open-webui:main
    environment:
      - WEBUI_CONCURRENCY=1
      - LOG_LEVEL=debug
      - "OLLAMA_BASE_URL=http://ollama:11434"
      - "WEBUI_SECRET_KEY="
      - "RAG_EMBEDDING_ENGINE=ollama"
      - "AUDIO_STT_ENGINE=openai"
      # comfy
      - ENABLE_IMAGE_GENERATION=True
      - IMAGE_GENERATION_ENGINE=comfyui
      - "COMFYUI_BASE_URL=http://host.docker.internal:8188"
      # weather
      - OPENWEATHER_API_KEY=984000b62623d48f5491c49968b71eef

  open-terminal:
        container_name: open-terminal
        restart: unless-stopped
        ports:
            - 8765:8000
        volumes:
            - open-terminal:/home/user
        environment:
            - OPEN_TERMINAL_API_KEY=your-secret-key
        image: ghcr.io/open-webui/open-terminal

volumes:
  open-webui:
    external: true
    name: open-webui
  ollama:
    external: true
    name: ollama
  open-terminal:
    external: true
    name: open-terminal