fix: Docker deployment - fix Dockerfiles, registry.py f-strings, Gateway app structure
This commit is contained in:
@@ -5,7 +5,7 @@ LABEL maintainer="DAARION.city Team"
|
|||||||
LABEL description="DevTools Backend - Development tools service"
|
LABEL description="DevTools Backend - Development tools service"
|
||||||
LABEL version="0.2.0"
|
LABEL version="0.2.0"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app/devtools-backend
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
@@ -13,11 +13,13 @@ RUN apt-get update && apt-get install -y \
|
|||||||
git \
|
git \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy requirements (from parent)
|
# Install Python dependencies
|
||||||
COPY ../requirements.txt .
|
RUN pip install --no-cache-dir \
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
fastapi==0.109.0 \
|
||||||
|
uvicorn==0.27.0 \
|
||||||
|
pydantic==2.5.3
|
||||||
|
|
||||||
# Copy application code
|
# Copy devtools backend code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
EXPOSE 8008
|
EXPOSE 8008
|
||||||
@@ -25,4 +27,4 @@ EXPOSE 8008
|
|||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD curl -f http://localhost:8008/health || exit 1
|
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"]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
version: '3.9'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# DAGI Router - Core routing service
|
# DAGI Router - Core routing service
|
||||||
router:
|
router:
|
||||||
@@ -72,7 +70,7 @@ services:
|
|||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
||||||
# Bot Gateway
|
# Bot Gateway (with DAARWIZZ)
|
||||||
gateway:
|
gateway:
|
||||||
build:
|
build:
|
||||||
context: ./gateway-bot
|
context: ./gateway-bot
|
||||||
@@ -84,6 +82,8 @@ services:
|
|||||||
- ROUTER_URL=http://router:9102
|
- ROUTER_URL=http://router:9102
|
||||||
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
|
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
|
||||||
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN:-}
|
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN:-}
|
||||||
|
- DAARWIZZ_NAME=DAARWIZZ
|
||||||
|
- DAARWIZZ_PROMPT_PATH=/app/gateway-bot/daarwizz_prompt.txt
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/app/logs
|
- ./logs:/app/logs
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -119,25 +119,7 @@ services:
|
|||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
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:
|
networks:
|
||||||
dagi-network:
|
dagi-network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
name: dagi-network
|
name: dagi-network
|
||||||
|
|
||||||
volumes:
|
|
||||||
ollama-data:
|
|
||||||
name: dagi-ollama-data
|
|
||||||
|
|||||||
@@ -5,19 +5,20 @@ LABEL maintainer="DAARION.city Team"
|
|||||||
LABEL description="Bot Gateway - Telegram/Discord webhook handler with DAARWIZZ"
|
LABEL description="Bot Gateway - Telegram/Discord webhook handler with DAARWIZZ"
|
||||||
LABEL version="0.2.0"
|
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/*
|
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy requirements and install
|
# Install minimal dependencies
|
||||||
COPY requirements.txt .
|
RUN pip install --no-cache-dir \
|
||||||
RUN pip install --no-cache-dir -r requirements.txt httpx
|
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 code and DAARWIZZ prompt
|
||||||
COPY gateway-bot/ /app/gateway-bot/
|
COPY . .
|
||||||
|
|
||||||
# Copy DAARWIZZ system prompt
|
|
||||||
COPY gateway-bot/daarwizz_prompt.txt /app/gateway-bot/daarwizz_prompt.txt
|
|
||||||
|
|
||||||
EXPOSE 9300
|
EXPOSE 9300
|
||||||
|
|
||||||
@@ -27,4 +28,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|||||||
ENV DAARWIZZ_NAME=DAARWIZZ
|
ENV DAARWIZZ_NAME=DAARWIZZ
|
||||||
ENV DAARWIZZ_PROMPT_PATH=/app/gateway-bot/daarwizz_prompt.txt
|
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
44
gateway-bot/app.py
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -11,7 +11,7 @@ from datetime import datetime
|
|||||||
from fastapi import APIRouter, HTTPException
|
from fastapi import APIRouter, HTTPException
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from .router_client import send_to_router
|
from router_client import send_to_router
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
# microDAO RBAC Dockerfile
|
# microDAO RBAC Service Dockerfile
|
||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
LABEL maintainer="DAARION.city Team"
|
LABEL maintainer="DAARION.city Team"
|
||||||
LABEL description="microDAO RBAC - Role-based access control service"
|
LABEL description="microDAO RBAC - Role-based access control service"
|
||||||
LABEL version="0.2.0"
|
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/*
|
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY ../requirements.txt .
|
# Install Python dependencies
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
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 . .
|
COPY . .
|
||||||
|
|
||||||
EXPOSE 9200
|
EXPOSE 9200
|
||||||
@@ -19,4 +24,4 @@ EXPOSE 9200
|
|||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD curl -f http://localhost:9200/health || exit 1
|
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"]
|
||||||
|
|||||||
@@ -5,13 +5,18 @@ LABEL maintainer="DAARION.city Team"
|
|||||||
LABEL description="CrewAI Orchestrator - Multi-agent workflow service"
|
LABEL description="CrewAI Orchestrator - Multi-agent workflow service"
|
||||||
LABEL version="0.2.0"
|
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/*
|
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY ../requirements.txt .
|
# Install Python dependencies
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
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 . .
|
COPY . .
|
||||||
|
|
||||||
EXPOSE 9010
|
EXPOSE 9010
|
||||||
@@ -19,4 +24,4 @@ EXPOSE 9010
|
|||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD curl -f http://localhost:9010/health || exit 1
|
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"]
|
||||||
|
|||||||
@@ -90,9 +90,11 @@ def build_provider_registry(config: RouterConfig) -> Dict[str, Provider]:
|
|||||||
)
|
)
|
||||||
|
|
||||||
registry[provider_id] = 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:
|
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")
|
logger.info(f"Provider registry built: {len(registry)} providers")
|
||||||
|
|||||||
Reference in New Issue
Block a user