diff --git a/.env.example b/.env.example index 0b45d2b..8d747ae 100644 --- a/.env.example +++ b/.env.example @@ -12,8 +12,8 @@ WORKSPACE_DIR=/workspace # Base SQLite (sessions, messages, config) DATA_DIR=/data -# Port d'accès sur la machine hôte (choisis-en un libre). 8717 par défaut. -HOST_PORT=8717 +# Port de l'application (identique dedans/dehors). 8717 par défaut. +PORT=8717 # Optionnel : URL d'une instance SearxNG pour l'outil web_search. # Si vide, web_search utilise DuckDuckGo (sans clé d'API). diff --git a/Dockerfile b/Dockerfile index c4e2cea..b4d7ec1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ WORKSPACE_DIR=/workspace \ DATA_DIR=/data \ - PORT=8080 + PORT=8717 # curl pour le HEALTHCHECK RUN apt-get update && apt-get install -y --no-install-recommends curl \ @@ -33,7 +33,7 @@ RUN mkdir -p /workspace /data # montés d'Unraid (/mnt/user/appdata/...), souvent détenus par root. Pour # durcir, surcharge l'utilisateur côté compose (ex. user: "99:100"). -EXPOSE 8080 +EXPOSE 8717 WORKDIR /app/backend HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ diff --git a/README.md b/README.md index b3b6975..8132f2d 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,7 @@ npm run dev # http://localhost:5173 | `DEFAULT_MODEL` | `llama3.1:8b` | Modèle sélectionné au démarrage | | `WORKSPACE_DIR` | `/workspace` | Dossier de travail de l'agent | | `DATA_DIR` | `/data` | Base SQLite (sessions + config) | -| `HOST_PORT` | `8717` | Port d'accès sur l'hôte | -| `PORT` | `8080` | Port interne du conteneur | +| `PORT` | `8717` | Port de l'application (dedans = dehors) | | `SEARX_URL` | *(vide)* | Instance SearxNG pour `web_search` (sinon DuckDuckGo) | ## Utilisation diff --git a/docker-compose.unraid.yml b/docker-compose.unraid.yml index 0811e05..e137bb4 100644 --- a/docker-compose.unraid.yml +++ b/docker-compose.unraid.yml @@ -23,15 +23,16 @@ services: image: ghcr.io/r0m1k3/loki:latest container_name: loki ports: - # Port d'accès Unraid (gauche). Change 8717 si déjà pris sur ton serveur. - - "8717:8080" + # Un seul numéro de port, identique dedans/dehors (évite tout décalage). + # Pour changer de port : modifie 8717 AUX DEUX endroits + PORT ci-dessous. + - "8717:8717" environment: # >>> À ADAPTER : IP de ton serveur Unraid (Ollama écoute sur :11434) <<< - OLLAMA_HOST=http://192.168.1.10:11434 - DEFAULT_MODEL=llama3.1:8b - WORKSPACE_DIR=/workspace - DATA_DIR=/data - - PORT=8080 + - PORT=8717 # Optionnel : instance SearxNG pour l'outil web_search (sinon DuckDuckGo) - SEARX_URL= volumes: @@ -40,10 +41,5 @@ services: extra_hosts: # Permet aussi OLLAMA_HOST=http://host.docker.internal:11434 - "host.docker.internal:host-gateway" - healthcheck: - test: ["CMD", "curl", "-fsS", "http://localhost:8080/api/health"] - interval: 30s - timeout: 5s - retries: 3 - start_period: 15s + # Le HEALTHCHECK est défini dans l'image (utilise automatiquement le bon port). restart: unless-stopped diff --git a/docker-compose.yml b/docker-compose.yml index 9a21386..e67292b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,14 +3,14 @@ services: build: . container_name: loki ports: - # Port d'accès sur l'hôte (gauche) -> port interne du conteneur (droite) - - "${HOST_PORT:-8717}:8080" + # Un seul numéro de port, identique dedans/dehors. + - "${PORT:-8717}:${PORT:-8717}" environment: - OLLAMA_HOST=${OLLAMA_HOST:-http://host.docker.internal:11434} - DEFAULT_MODEL=${DEFAULT_MODEL:-llama3.1:8b} - WORKSPACE_DIR=/workspace - DATA_DIR=/data - - PORT=8080 + - PORT=${PORT:-8717} # Optionnel : instance SearxNG pour web_search (sinon DuckDuckGo) - SEARX_URL=${SEARX_URL:-} volumes: @@ -19,12 +19,7 @@ services: extra_hosts: # Permet d'atteindre un Ollama installé sur la machine hôte - "host.docker.internal:host-gateway" - healthcheck: - test: ["CMD", "curl", "-fsS", "http://localhost:8080/api/health"] - interval: 30s - timeout: 5s - retries: 3 - start_period: 10s + # Le HEALTHCHECK est défini dans l'image (utilise automatiquement $PORT). restart: unless-stopped # ── Ollama optionnel ──────────────────────────────────────────────────