services:
  karakeep-app:
    container_name: karakeep-app
    image: ghcr.io/karakeep-app/karakeep:0.32.0
    restart: unless-stopped
    networks:
      - homelab-network
    security_opt:
      - no-new-privileges:true
    volumes:
      - ~/docker-volumes/karakeep/data:/data
    ports:
      - 4070:4070
    environment:
      - PORT=4070
      - API_URL=http://localhost:4070
      - NEXTAUTH_URL=${KARAKEEP_NEXTAUTH_URL}
      - NEXTAUTH_SECRET=${KARAKEEP_NEXTAUTH_SECRET}
      - MEILI_ADDR=http://karakeep-meilisearch:7700
      - MEILI_MASTER_KEY=${KARAKEEP_MEILI_MASTER_KEY}
      - BROWSER_WEB_URL=http://karakeep-chrome:9222
      - OPENAI_API_KEY=ollama
      - OPENAI_BASE_URL=http://ollama:11434/v1
      - INFERENCE_TEXT_MODEL=llama3.2:3b
      - INFERENCE_IMAGE_MODEL=minicpm-v:8b
      - DATA_DIR=/data
      - DISABLE_SIGNUPS=false
      - CRAWLER_STORE_SCREENSHOT=true
      - CRAWLER_FULL_PAGE_SCREENSHOT=true
      - CRAWLER_ENABLE_ADBLOCKER=true

  karakeep-chrome:
    container_name: karakeep-chrome
    image: gcr.io/zenika-hub/alpine-chrome:124
    restart: unless-stopped
    networks:
      - homelab-network
    security_opt:
      - no-new-privileges:true
    command:
      - --no-sandbox
      - --disable-gpu
      - --disable-dev-shm-usage
      - --remote-debugging-address=0.0.0.0
      - --remote-debugging-port=9222
      - --hide-scrollbars

  karakeep-meilisearch:
    container_name: karakeep-meilisearch
    image: docker.io/getmeili/meilisearch:v1.43.0
    restart: unless-stopped
    networks:
      - homelab-network
    security_opt:
      - no-new-privileges:true
    environment:
      - MEILI_NO_ANALYTICS=true
      - MEILI_ADDR=http://127.0.0.1:7700
      - MEILI_MASTER_KEY=${KARAKEEP_MEILI_MASTER_KEY}
    volumes:
      - ~/docker-volumes/karakeep/meilisearch:/meili_data
