feat(fase2): add Flow models, Flow Engine setup, update Docker Compose
- Add Flow and FlowSession SQLAlchemy models for chatbot flows - Add TriggerType enum (welcome, keyword, fallback, event, manual) - Setup flow-engine service with FastAPI structure - Add flow-engine to docker-compose.yml Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
17
services/flow-engine/Dockerfile
Normal file
17
services/flow-engine/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
libpq-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY app ./app
|
||||
|
||||
EXPOSE 8001
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"]
|
||||
1
services/flow-engine/app/__init__.py
Normal file
1
services/flow-engine/app/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# WhatsApp Centralizado - Flow Engine
|
||||
17
services/flow-engine/app/config.py
Normal file
17
services/flow-engine/app/config.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from functools import lru_cache
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
DATABASE_URL: str = "postgresql://whatsapp_admin:password@localhost:5432/whatsapp_central"
|
||||
REDIS_URL: str = "redis://localhost:6379"
|
||||
API_GATEWAY_URL: str = "http://localhost:8000"
|
||||
WHATSAPP_CORE_URL: str = "http://localhost:3001"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
return Settings()
|
||||
8
services/flow-engine/requirements.txt
Normal file
8
services/flow-engine/requirements.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
fastapi==0.115.6
|
||||
uvicorn[standard]==0.34.0
|
||||
sqlalchemy==2.0.36
|
||||
psycopg2-binary==2.9.10
|
||||
redis==5.2.1
|
||||
httpx==0.28.1
|
||||
pydantic==2.10.4
|
||||
pydantic-settings==2.7.1
|
||||
Reference in New Issue
Block a user