fix: Docker deployment - fix Dockerfiles, registry.py f-strings, Gateway app structure

This commit is contained in:
Ivan Tytar
2025-11-15 15:59:42 +01:00
parent ff01021f96
commit df0055bb03
8 changed files with 90 additions and 49 deletions

View File

@@ -5,7 +5,7 @@ LABEL maintainer="DAARION.city Team"
LABEL description="DevTools Backend - Development tools service"
LABEL version="0.2.0"
WORKDIR /app
WORKDIR /app/devtools-backend
# Install system dependencies
RUN apt-get update && apt-get install -y \
@@ -13,11 +13,13 @@ RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements (from parent)
COPY ../requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir \
fastapi==0.109.0 \
uvicorn==0.27.0 \
pydantic==2.5.3
# Copy application code
# Copy devtools backend code
COPY . .
EXPOSE 8008
@@ -25,4 +27,4 @@ EXPOSE 8008
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8008/health || exit 1
CMD ["python", "main.py", "--host", "0.0.0.0", "--port", "8008"]
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8008"]

View File

@@ -1,5 +1,3 @@
version: '3.9'
services:
# DAGI Router - Core routing service
router:
@@ -72,7 +70,7 @@ services:
timeout: 10s
retries: 3
# Bot Gateway
# Bot Gateway (with DAARWIZZ)
gateway:
build:
context: ./gateway-bot
@@ -84,6 +82,8 @@ services:
- ROUTER_URL=http://router:9102
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN:-}
- DAARWIZZ_NAME=DAARWIZZ
- DAARWIZZ_PROMPT_PATH=/app/gateway-bot/daarwizz_prompt.txt
volumes:
- ./logs:/app/logs
depends_on:
@@ -119,25 +119,7 @@ services:
timeout: 10s
retries: 3
# Ollama (Local LLM)
# Note: This requires ollama to be installed on host or use ollama/ollama image
# Uncomment if you want to run Ollama in Docker
# ollama:
# image: ollama/ollama:latest
# container_name: dagi-ollama
# ports:
# - "11434:11434"
# volumes:
# - ollama-data:/root/.ollama
# networks:
# - dagi-network
# restart: unless-stopped
networks:
dagi-network:
driver: bridge
name: dagi-network
volumes:
ollama-data:
name: dagi-ollama-data

View File

@@ -5,19 +5,20 @@ LABEL maintainer="DAARION.city Team"
LABEL description="Bot Gateway - Telegram/Discord webhook handler with DAARWIZZ"
LABEL version="0.2.0"
WORKDIR /app
WORKDIR /app/gateway-bot
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt httpx
# Install minimal dependencies
RUN pip install --no-cache-dir \
fastapi==0.109.0 \
uvicorn==0.27.0 \
httpx==0.26.0 \
pydantic==2.5.3 \
python-multipart==0.0.6
# Copy gateway code
COPY gateway-bot/ /app/gateway-bot/
# Copy DAARWIZZ system prompt
COPY gateway-bot/daarwizz_prompt.txt /app/gateway-bot/daarwizz_prompt.txt
# Copy gateway code and DAARWIZZ prompt
COPY . .
EXPOSE 9300
@@ -27,4 +28,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
ENV DAARWIZZ_NAME=DAARWIZZ
ENV DAARWIZZ_PROMPT_PATH=/app/gateway-bot/daarwizz_prompt.txt
CMD ["python", "-m", "gateway_bot.main", "--host", "0.0.0.0", "--port", "9300"]
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9300"]

44
gateway-bot/app.py Normal file
View File

@@ -0,0 +1,44 @@
"""
FastAPI app instance for Gateway Bot
"""
import logging
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from http_api import router as gateway_router
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(name)s: %(message)s"
)
app = FastAPI(
title="Bot Gateway with DAARWIZZ",
version="1.0.0",
description="Gateway service for Telegram/Discord bots → DAGI Router"
)
# CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Include gateway routes
app.include_router(gateway_router, prefix="", tags=["gateway"])
@app.get("/")
async def root():
return {
"service": "bot-gateway",
"version": "1.0.0",
"agent": "DAARWIZZ",
"endpoints": [
"POST /telegram/webhook",
"POST /discord/webhook",
"GET /health"
]
}

View File

@@ -11,7 +11,7 @@ from datetime import datetime
from fastapi import APIRouter, HTTPException
from pydantic import BaseModel
from .router_client import send_to_router
from router_client import send_to_router
logger = logging.getLogger(__name__)

View File

@@ -1,17 +1,22 @@
# microDAO RBAC Dockerfile
# microDAO RBAC Service Dockerfile
FROM python:3.11-slim
LABEL maintainer="DAARION.city Team"
LABEL description="microDAO RBAC - Role-based access control service"
LABEL version="0.2.0"
WORKDIR /app
WORKDIR /app/microdao
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
COPY ../requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir \
fastapi==0.109.0 \
uvicorn==0.27.0 \
pydantic==2.5.3 \
sqlalchemy==2.0.25
# Copy RBAC code
COPY . .
EXPOSE 9200
@@ -19,4 +24,4 @@ EXPOSE 9200
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:9200/health || exit 1
CMD ["python", "rbac_api.py", "--host", "0.0.0.0", "--port", "9200"]
CMD ["python", "-m", "uvicorn", "rbac_api:app", "--host", "0.0.0.0", "--port", "9200"]

View File

@@ -5,13 +5,18 @@ LABEL maintainer="DAARION.city Team"
LABEL description="CrewAI Orchestrator - Multi-agent workflow service"
LABEL version="0.2.0"
WORKDIR /app
WORKDIR /app/orchestrator
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
COPY ../requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir \
fastapi==0.109.0 \
uvicorn==0.27.0 \
pydantic==2.5.3 \
httpx==0.26.0
# Copy orchestrator code
COPY . .
EXPOSE 9010
@@ -19,4 +24,4 @@ EXPOSE 9010
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:9010/health || exit 1
CMD ["python", "crewai_backend.py", "--host", "0.0.0.0", "--port", "9010"]
CMD ["python", "-m", "uvicorn", "crewai_backend:app", "--host", "0.0.0.0", "--port", "9010"]

View File

@@ -90,9 +90,11 @@ def build_provider_registry(config: RouterConfig) -> Dict[str, Provider]:
)
registry[provider_id] = provider
logger.info(f" + {provider_id}: Orchestrator @ {orch_config["base_url"]}")
base_url = orch_config.get("base_url", "N/A")
logger.info(f" + {provider_id}: Orchestrator @ {base_url}")
else:
logger.warning(f"Unknown orchestrator type: {orch_config.get("type")}")
orch_type = orch_config.get("type", "N/A")
logger.warning(f"Unknown orchestrator type: {orch_type}")
logger.info(f"Provider registry built: {len(registry)} providers")