services:
  ollama:
    container_name: ollama
    image: ollama/ollama:0.23.2
    restart: unless-stopped
    networks:
      - homelab-network
    security_opt:
      - no-new-privileges:true
    environment:
      - TZ=Africa/Nairobi
      - OLLAMA_KEEP_ALIVE=15m
      - OLLAMA_HOST=0.0.0.0:11434
      - OLLAMA_MODELS=ollama-models
    volumes:
      - ~/docker-volumes/ollama/data:/root/.ollama
      - ~/docker-volumes/ollama/models:/ollama-models

  open-webui:
    container_name: open-webui
    image: ghcr.io/open-webui/open-webui:v0.9.5
    restart: unless-stopped
    networks:
      - homelab-network
    security_opt:
      - no-new-privileges:true
    environment:
      - TZ=Africa/Nairobi
      - OLLAMA_BASE_URL=http://ollama:11434
    depends_on:
      - ollama
    ports:
      - 5020:8080
    volumes:
      - ~/docker-volumes/open-webui/data:/app/backend/data
