feat: NanoClaude 프로덕션 통합 — Docker, Caddy, aiosqlite 로깅
- docker-compose에 nanoclaude 서비스 추가 (포트 8100) - Caddy /nano/* → nanoclaude 리버스 프록시 (SSE flush) - aiosqlite 요청/응답 로깅 (request_logs 테이블) - .env.example, CLAUDE.md 업데이트 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from config import settings
|
||||
from db.database import init_db
|
||||
from routers import chat
|
||||
|
||||
logging.basicConfig(
|
||||
@@ -16,10 +18,17 @@ logging.basicConfig(
|
||||
format="%(asctime)s %(levelname)s %(name)s — %(message)s",
|
||||
)
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
await init_db()
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(
|
||||
title="NanoClaude",
|
||||
version="0.1.0",
|
||||
description="비동기 job 기반 AI Gateway — Phase 1",
|
||||
lifespan=lifespan,
|
||||
)
|
||||
|
||||
app.add_middleware(
|
||||
|
||||
Reference in New Issue
Block a user