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,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__)