From 3d8485c2a4916bc5b38e836c008d292c83c88e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kadir=20Y=C3=B6nak?= Date: Sun, 23 Aug 2026 22:14:49 +0300 Subject: [PATCH] =?UTF-8?q?fix(compose):=20standalone=20chatbot=20'up'=20a?= =?UTF-8?q?rt=C4=B1k=20dev=20web=20UI=20=C3=A7al=C4=B1=C5=9Ft=C4=B1r=C4=B1?= =?UTF-8?q?r=20(exit=20de=C4=9Fil)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sorun: 'podman compose up' chatbot reposunda container'ı 'python -m src.main --validate' ile başlatıyordu -> katalog doğrulanıp exit 0 ile çıkıyordu ('sürekli exit'). Bu bir podman hatası değil; --validate tek-seferlik komut. Çözüm: command -> 'python -m src.web --host 0.0.0.0 --port 8000' (uzun-çalışan dev sohbet arayüzü) + port 8000:8000 + healthcheck + restart. Artık 'up' deyince http://localhost:8000 açık kalır. Tam ürün için kök compose (README/başlık notu). --- compose.yaml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/compose.yaml b/compose.yaml index e776d7a..39d204e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,3 +1,14 @@ +# Çelebi kural-tabanlı chatbot — TEK BAŞINA (standalone) çalıştırma. +# +# podman compose up --build -> http://localhost:8000 (geliştirici sohbet arayüzü) +# +# Not: Bu compose chatbot'u TEK BAŞINA (backend olmadan) çalıştırır — offline motoru +# denemek için dev web arayüzü açar ve AÇIK KALIR. Backend'e bağlı QUIC köprüsü ve +# tam ürün (backend + frontend + surrealdb) için KÖK dizindeki compose'u kullan: +# cd .. && podman compose up -d --build +# +# Yalnızca katalog doğrulaması (tek-seferlik, çıkar) istersen: +# podman compose run --rm chatbot python -m src.main --validate services: chatbot: build: @@ -5,4 +16,16 @@ services: dockerfile: Containerfile image: localhost/rule-based-chatbot:local init: true - command: ["python", "-m", "src.main", "--validate"] + # Uzun-çalışan servis: geliştirici web arayüzü. Container içinde host'tan + # erişilebilmesi için 0.0.0.0'a bind eder. + 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