Initial commit.

This commit is contained in:
2026-05-31 00:51:56 +02:00
commit 4a8a51d3cc
8 changed files with 156 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
# --- MODEL SELECTION ---
MODEL_LIST=ministral-3:3b
# --- NETZWORK ---
DNS_SERVER=8.8.8.8
+3
View File
@@ -0,0 +1,3 @@
.env
storage/
logs/
+11
View File
@@ -0,0 +1,11 @@
services:
ollama:
shm_size: '8gb'
devices:
- /dev/dri:/dev/dri
- /dev/kfd:/dev/kfd
environment:
# For AMD (Navi 31): 11.0.0 | For APUs: 10.3.0
- HSA_OVERRIDE_GFX_VERSION=11.0.0
#- OLLAMA_VULKAN=1 # only activate on problems with default (rocm)
- OLLAMA_FLASH_ATTENTION=1
+12
View File
@@ -0,0 +1,12 @@
services:
ollama:
shm_size: '8gb'
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
environment:
- NVIDIA_VISIBLE_DEVICES=all
Executable
+49
View File
@@ -0,0 +1,49 @@
services:
# --- LLM ENGINE ---
ollama:
build: ./providers/llm/ollama
container_name: ollama
restart: always
volumes:
- ./storage/ollama_models:/root/.ollama
environment:
- MODEL_LIST=${MODEL_LIST:-ministral-3:3b}
ports:
- "11434:11434" # only required for external access
dns:
- ${DNS_SERVER:-1.1.1.1}
networks:
- net.ghost.openclaw
# --- SEARCH ENGINE ---
#searxng:
# image: docker.io/searxng/searxng:latest
# container_name: searxng
# restart: always
# volumes:
# - ./providers/search/engine/settings.yml:/etc/searxng/settings.yml:ro
# networks:
# - net.ghost.openclaw
# --- CORE AGENT ---
#agent:
# build:
# context: .
# dockerfile: core/agent/docker/Containerfile
# container_name: openclaw-agent
# depends_on:
# - ollama
# - searxng
# environment:
# - OLLAMA_HOST=http://ollama:11434
# - SEARXNG_URL=http://searxng:8080
# - MCP_SEARXNG_PATH=/app/mcp-bridge/dist/index.js
# volumes:
# - ./storage/workspace:/app/workspace:rw
# - ./storage/knowledge:/app/knowledge:ro
# networks:
# - net.ghost.openclaw
networks:
net.ghost.openclaw:
driver: bridge
+4
View File
@@ -0,0 +1,4 @@
FROM docker.io/ollama/ollama:latest
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+59
View File
@@ -0,0 +1,59 @@
#!/bin/bash
# --- FUNKTION: Signal-Handling ---
# Diese Funktion wird aufgerufen, wenn der Container gestoppt werden soll (SIGTERM/SIGINT)
cleanup() {
echo "--- Abbruchsignal empfangen! Beende Ollama sauber... ---"
kill "$OLLAMA_PID" 2>/dev/null
wait "$OLLAMA_PID" 2>/dev/null
exit 0
}
# Registriere die Cleanup-Funktion für SIGTERM (Stop) und SIGINT (Strg+C)
trap cleanup SIGTERM SIGINT
# --- SCHRITT 1: Ollama Server starten ---
echo "--- Starte Ollama Server im Hintergrund ---"
ollama serve &
OLLAMA_PID=$!
# --- SCHRITT 2: Health-Check (Warten bis der Server bereit ist) ---
echo "--- Warte auf Ollama Server (TCP Check) ---"
MAX_RETRIES=30
COUNT=0
# Wir nutzen den Bash-eigenen TCP-Check (benötigt kein curl!)
until (exec 3<>/dev/tcp/localhost/11434) &>/dev/null || [ $COUNT -eq $MAX_RETRIES ]; do
sleep 2
COUNT=$((COUNT + 1))
echo "Warte auf Server... ($COUNT/$MAX_RETRIES)"
done
# Schließe den Test-Socket sauber
exec 3>&- 2>/dev/null || true
if [ $COUNT -eq $MAX_RETRIES ]; then
echo "FEHLER: Ollama Server ist nach 60 Sekunden nicht bereit."
exit 1
fi
echo "--- Ollama Server ist online! ---"
# --- SCHRITT 3: Modelle herunterladen ---
if [ -z "$MODEL_LIST" ]; then
echo "WARNUNG: Keine Modelle in MODEL_LIST definiert."
else
IFS=',' read -ra MODELS <<< "$MODEL_LIST"
echo "--- Modell-Check gestartet ---"
for model in "${MODELS[@]}"; do
model=$(echo "$model" | xargs) # Leerzeichen entfernen
echo "Prüfe Modell: $model"
# Pull ausführen. Wenn es schon da ist, geht das extrem schnell.
ollama pull "$model"
done
echo "--- Alle Modelle sind bereit ---"
fi
# --- SCHRITT 4: Hauptprozess halten ---
# Wir warten auf den Ollama-Prozess. Wenn er stirbt, endet auch das Skript.
wait $OLLAMA_PID
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
# run.sh
if [ "$1" == "amd" ]; then
podman-compose -f compose.yaml -f compose.amd.yaml up -d --build
elif [ "$1" == "nvidia" ]; then
podman-compose -f compose.yaml -f compose.nvidia.yaml up -d --build
elif [ "$1" == "cpu" ]; then
podman-compose up -d --build
else
echo "Please select Hardware: ./run.sh [amd|nvidia|cpu]"
podman-compose up -d --build
fi