Add FastAPI app for report generation with Docker support

Implement a modular FastAPI-based service for generating research reports using `GPTResearcher`. Includes secure API key authentication, a streaming response endpoint, and a Dockerized deployment setup. Also adds documentation, core dependencies, and project structure.
This commit is contained in:
ThomasTaroni 2025-04-25 08:34:18 +02:00
commit 3d0d2b2770
8 changed files with 289 additions and 0 deletions

25
Dockerfile Normal file
View file

@ -0,0 +1,25 @@
# Use the official Python image as a base
FROM python:3.13-slim
# Set environment variable for Python
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set working directory within the container
WORKDIR /app
# Copy the requirements file if you have it (or define dependencies manually)
# If you don't have a requirements.txt, let me know and I'll guide you further
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the project files into the container
COPY src/ /app/
# Expose the port that FastAPI will run on
EXPOSE 8000
# Set the default command to run the app with `uvicorn`
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]