# docker-compose.yml – SearXNG & Redis

### **3.1 Zweck dieses Kapitels**

Dieses Kapitel dokumentiert die eingesetzten **Docker-Compose-Scripte**, um das System reproduzierbar aufzubauen.  
Alle Konfigurationen sind produktiv getestet und bilden den **IST-Zustand** des Systems ab.

Ziel ist **Nachvollziehbarkeit**, nicht Optimierung.

---

### **3.2 docker-compose.yml – SearXNG &amp; Redis**

**Zweck:**

- Self-hosted Web-Suche
- JSON-API für Suchanfragen
- Redis als Cache/Backend

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-version%3A-%223.9%22-servi"><div class="sticky top-[calc(var(--sticky-padding-top)+9*var(--spacing))]"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-attr">version:</span> <span class="hljs-string">"3.9"</span><span class="hljs-attr">services:</span>  <span class="hljs-attr">redis:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">redis:7-alpine</span>    <span class="hljs-attr">container_name:</span> <span class="hljs-string">searxng_redis</span>    <span class="hljs-attr">restart:</span> <span class="hljs-string">unless-stopped</span>    <span class="hljs-attr">command:</span> <span class="hljs-string">redis-server</span> <span class="hljs-string">--save</span> <span class="hljs-string">""</span> <span class="hljs-string">--appendonly</span> <span class="hljs-literal">no</span>    <span class="hljs-attr">volumes:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">./redis:/data</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">mein-netzwerk</span>  <span class="hljs-attr">searxng:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">searxng/searxng:latest</span>    <span class="hljs-attr">container_name:</span> <span class="hljs-string">searxng</span>    <span class="hljs-attr">restart:</span> <span class="hljs-string">unless-stopped</span>    <span class="hljs-attr">depends_on:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">redis</span>    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">"999:8080"</span>   <span class="hljs-comment"># Host-Port 999 → Container-Port 8080</span>    <span class="hljs-attr">environment:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">SEARXNG_BASE_URL=http://<HOST-IP>:999/</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">SEARXNG_REDIS_URL=redis://searxng_redis:6379/0</span>    <span class="hljs-attr">volumes:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">./searxng:/etc/searxng:rw</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">mein-netzwerk</span><span class="hljs-attr">networks:</span>  <span class="hljs-attr">mein-netzwerk:</span>    <span class="hljs-attr">external:</span> <span class="hljs-literal">true</span>    <span class="hljs-attr">name:</span> <span class="hljs-string">mein-netzwerk</span>`</div></div>**Erläuterung:**

- SearXNG läuft **intern auf Port 8080**
- Port `999` ist **nur für externen Browser-Zugriff**
- Interne Container-Kommunikation erfolgt über:
    
    <div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary"><div class="sticky top-[calc(var(--sticky-padding-top)+9*var(--spacing))]"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">`http:<span class="hljs-comment">//searxng:8080</span>`</div></div>
- Redis wird ausschließlich intern genutzt

---

### **3.3 docker-compose.yml – AnythingLLM**

**Zweck:**

- Web-UI für KI-Interaktion
- Dokumenten-Analyse (RAG)
- Agenten (Web Search, Scraping – eingeschränkt)

<div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary" id="bkmrk-version%3A-%223.9%22-servi-1"><div class="sticky top-[calc(var(--sticky-padding-top)+9*var(--spacing))]"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-attr">version:</span> <span class="hljs-string">"3.9"</span><span class="hljs-attr">services:</span>  <span class="hljs-attr">anythingllm:</span>    <span class="hljs-attr">image:</span> <span class="hljs-string">mintplexlabs/anythingllm:latest</span>    <span class="hljs-attr">container_name:</span> <span class="hljs-string">anythingllm</span>    <span class="hljs-attr">restart:</span> <span class="hljs-string">unless-stopped</span>    <span class="hljs-attr">ports:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">"100:3001"</span>   <span class="hljs-comment"># Host-Port 100 → Web-UI</span>    <span class="hljs-attr">cap_add:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">SYS_ADMIN</span>    <span class="hljs-comment"># notwendig für Chromium/Puppeteer</span>    <span class="hljs-attr">shm_size:</span> <span class="hljs-string">"2gb"</span> <span class="hljs-comment"># Stabilität für Headless Browser</span>    <span class="hljs-attr">dns:</span>      <span class="hljs-bullet">-</span> <span class="hljs-number">1.1</span><span class="hljs-number">.1</span><span class="hljs-number">.1</span>      <span class="hljs-bullet">-</span> <span class="hljs-number">8.8</span><span class="hljs-number">.8</span><span class="hljs-number">.8</span>    <span class="hljs-attr">environment:</span>      <span class="hljs-attr">STORAGE_DIR:</span> <span class="hljs-string">/app/server/storage</span>      <span class="hljs-attr">SERVER_PORT:</span> <span class="hljs-number">3001</span>      <span class="hljs-attr">NODE_ENV:</span> <span class="hljs-string">production</span>      <span class="hljs-comment"># LocalAI Anbindung (OpenAI-kompatibel)</span>      <span class="hljs-attr">OPENAI_API_BASE_URL:</span> <span class="hljs-string">"http://localai:8080/v1"</span>      <span class="hljs-attr">OPENAI_API_KEY:</span> <span class="hljs-string">"vitruvian"</span>      <span class="hljs-attr">DISABLE_OPEN_AI:</span> <span class="hljs-string">"true"</span>      <span class="hljs-comment"># Chromium Stabilisierung</span>      <span class="hljs-attr">PUPPETEER_ARGS:</span> <span class="hljs-string">"--no-sandbox --disable-setuid-sandbox --disable-dev-shm-usage"</span>    <span class="hljs-attr">volumes:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">/home/vitruvian/0_docker/100_anything/storage:/app/server/storage</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">/home/vitruvian/0_docker/100_anything/.env:/app/server/.env</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">/home/vitruvian/0_docker/8080_ki/ki_docs:/data/ki_docs</span>    <span class="hljs-attr">networks:</span>      <span class="hljs-bullet">-</span> <span class="hljs-string">mein-netzwerk</span><span class="hljs-attr">networks:</span>  <span class="hljs-attr">mein-netzwerk:</span>    <span class="hljs-attr">external:</span> <span class="hljs-literal">true</span>    <span class="hljs-attr">name:</span> <span class="hljs-string">mein-netzwerk</span>`</div></div>**Erläuterung:**

- AnythingLLM nutzt **LocalAI** als KI-Backend
- Kommunikation intern über Docker-DNS:
    
    <div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary"><div class="sticky top-[calc(var(--sticky-padding-top)+9*var(--spacing))]"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">`http://localai:8080/v1`</div></div>
- Web-UI extern erreichbar über:
    
    <div class="contain-inline-size rounded-2xl corner-superellipse/1.1 relative bg-token-sidebar-surface-primary"><div class="sticky top-[calc(var(--sticky-padding-top)+9*var(--spacing))]"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
    </div></div></div><div class="overflow-y-auto p-4" dir="ltr">`http:<span class="hljs-comment">//<HOST-IP>:100</span>`</div></div>
- Chromium/Puppeteer ist aktiviert, um Web-Inhalte laden zu können

---

### **3.4 Wichtiger Architekturhinweis (prüfungsrelevant)**

Mehrere Container verwenden **intern Port 8080**:

- `localai:8080`
- `searxng:8080`

➡️ **Kein Konflikt**, da jeder Container einen eigenen Netzwerk-Namespace besitzt.  
Der Konflikt besteht nur auf **Host-Ebene**, weshalb unterschiedliche **Host-Ports** (8080, 999, 100) verwendet werden.

---

### **3.5 Zusammenfassung**

- Die docker-compose-Konfiguration ist **technisch korrekt**
- Alle Dienste sind erreichbar und getestet
- Netzwerk- und Port-Konfiguration sind **nicht Ursache der Fehlfunktion**
- Das spätere Problem liegt **nicht in den Scripten**, sondern in der Tool-Logik von AnythingLLM