From 7103c5cc0e9cf1bb317848b63e820582c952584e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kadir=20Y=C3=B6nak?= Date: Mon, 24 Aug 2026 01:06:04 +0300 Subject: [PATCH] =?UTF-8?q?fix(compose):=20yaln=C4=B1z=20=C3=BCr=C3=BCn=20?= =?UTF-8?q?k=C3=B6pr=C3=BCs=C3=BCn=C3=BC=20=C3=A7al=C4=B1=C5=9Ft=C4=B1r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReadMe.md | 4 ++-- compose.yaml | 37 +++++-------------------------------- deploy/PODMAN-WSL-SETUP.md | 6 +++--- deploy/run-stack.ps1 | 3 +-- 4 files changed, 11 insertions(+), 39 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index c5ef6af..52ff27a 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -117,8 +117,8 @@ python -m src.main --evaluate # benchmark üzerinde tam metrik raporu python -m src.main --chat # etkileşimli terminal asistanı python -m src.web # geliştirici web arayüzü (http://127.0.0.1:8000) -# Podman (motor podman; sadece bu chatbot, tek başına) -podman compose up -d --build # izole geliştirici sohbet UI -> http://localhost:8000 +# Podman ürün köprüsü (önce backend compose ayakta olmalı) +podman compose up -d --build # yalnız hezarfen-chatbot-bridge ``` **Tüm yığın (backend + frontend + chatbot) — PROJE-BAZLI (all-in-one compose yok):** diff --git a/compose.yaml b/compose.yaml index 4028c47..d683cb1 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,38 +1,10 @@ -# Çelebi kural-tabanlı chatbot — proje-bazlı çalıştırma (kök compose GEREKMEZ). +# Çelebi ürün köprüsü — bu compose yalnızca TEK chatbot container'ı oluşturur. +# Önce backend compose ayakta olmalı; backend ağına bağlanıp QUIC/UDP ile +# hezarfen-backend:8090 adresine dial-in eder. Host portu veya demo web UI açmaz. # -# 1) TEK BAŞINA (backend olmadan) — geliştirici sohbet arayüzü: -# podman compose up -d --build -> http://localhost:8000 -# Bu her makinede (Linux/WSL) sorunsuz çalışır; hiçbir dış servise bağlı değildir. -# -# 2) ÜRÜN modu (backend'e bağlı köprü) — önce backend ayakta olmalı: -# cd ../hezarfen_backend && podman compose up -d -# cd ../Hezarfen-Rule-Based-Chatbot && podman compose --profile product up -d -# 'bridge' servisi backend'in ağına (hezarfen_backend_default) dial-in eder. -# -# Not: 'web' profilsizdir -> 'up' her zaman onu başlatır ve TEK BAŞINA yeter. -# 'bridge' yalnız '--profile product' ile gelir (backend ağı gerektiği için). +# podman compose up -d --build services: - web: - build: - context: . - dockerfile: Containerfile - image: localhost/rule-based-chatbot:local - container_name: hezarfen-chatbot-web - init: true - command: ["python", "-m", "src.web", "--host", "0.0.0.0", "--port", "8000"] - ports: - - "8000:8000" - restart: unless-stopped - healthcheck: - test: ["CMD", "python", "-c", - "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/')"] - interval: 30s - timeout: 5s - retries: 3 - start_period: 5s - bridge: - profiles: ["product"] build: context: . dockerfile: Containerfile @@ -42,6 +14,7 @@ services: command: ["python", "-m", "src.bridge"] environment: AI_BRIDGE_HOST: hezarfen-backend # backend container'ının adı + # aioquic bu hedefe UDP ile bağlanır; burada TCP port yayını yoktur. AI_BRIDGE_PORT: "8090" AI_BACKEND_URL: http://hezarfen-backend:8080 AI_SHARED_TOKEN: change-me # backend ile AYNI olmalı diff --git a/deploy/PODMAN-WSL-SETUP.md b/deploy/PODMAN-WSL-SETUP.md index 737db95..9f0beaf 100644 --- a/deploy/PODMAN-WSL-SETUP.md +++ b/deploy/PODMAN-WSL-SETUP.md @@ -84,9 +84,9 @@ Ya da elle (her repo kendi compose'uyla; sıra önemli — backend ağı yaratı ```powershell cd ..\hezarfen_backend ; & $P compose up -d --build # surrealdb + backend (:8080,:8090) cd ..\hezarfen_frontend ; & $P compose up -d --build # frontend (:5173) -cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose --profile product up -d --build bridge # chatbot köprüsü +cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose up -d --build # yalnız chatbot köprüsü ``` -> Chatbot'u backend'siz **tek başına** denemek için: `cd Hezarfen-Rule-Based-Chatbot; & $P compose up -d` → `http://localhost:8000` (izole dev sohbet UI). +> Chatbot compose yalnız ürün köprüsünü çalıştırır; demo web container'ı ve host port yayını yoktur. > **Linux/macOS:** kernel/machine adımları gerekmez; sadece bu bölümü çalıştır. Portlar zaten host'a iletilir. --- @@ -103,7 +103,7 @@ cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose --profile product up -d --build ## Durdurma / temizlik (her repo kendi dizininde) ```powershell -cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose --profile product down +cd ..\Hezarfen-Rule-Based-Chatbot ; & $P compose down cd ..\hezarfen_frontend ; & $P compose down cd ..\hezarfen_backend ; & $P compose down # volume kalır cd ..\hezarfen_backend ; & $P compose down -v # volume'ları da sil diff --git a/deploy/run-stack.ps1 b/deploy/run-stack.ps1 index 77e28a6..32c14d5 100644 --- a/deploy/run-stack.ps1 +++ b/deploy/run-stack.ps1 @@ -47,8 +47,7 @@ function Compose-Up([string]$dir, [string[]]$extra) { } Compose-Up $backend @() # ağı (hezarfen_backend_default) yaratır Compose-Up $frontend @() # backend ağına bağlanır -Compose-Up $chatbot @("--profile", "product") # bridge; backend ağına dial-in eder -# (Not: chatbot'u backend'siz TEK BAŞINA denemek için: cd $chatbot; podman compose up -d -> :8000) +Compose-Up $chatbot @() # yalnız bridge; backend ağına dial-in eder Write-Host "`n[3/3] Doğrulama..." Start-Sleep -Seconds 6