* fixed blocking call * fixed blocking call * fixed r2r flows * fastapi wrapper and containerization * chore: add langgraph-checkpoint-postgres as a dependency in pyproject.toml - Included "langgraph-checkpoint-postgres>=2.0.23" in the dependencies section to enhance project capabilities. * feat: add .env.example for environment variable configuration - Introduced a new .env.example file to provide a template for required and optional API keys. - Updated .env.production to ensure consistent formatting. - Enhanced deploy.sh with a project name variable and improved health check logic. - Modified docker-compose.production.yml to enforce required POSTGRES_PASSWORD environment variable. - Updated README.md and devcontainer scripts to reflect changes in .env file creation. - Improved code formatting and consistency across various files. * fix: update .gitignore and clean up imports in webapp.py and rag_agent.py - Modified .gitignore to include task files for better organization. - Cleaned up unused imports and improved function calls in webapp.py for better readability. - Updated rag_agent.py to streamline import statements and enhance type safety in function definitions. - Refactored validation logic in check_duplicate.py to simplify checks for sanitized names. * Update src/biz_bud/webapp.py Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> * Update src/biz_bud/agents/rag/retriever.py Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> * Update Dockerfile.production Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> * Update packages/business-buddy-tools/src/bb_tools/r2r/tools.py Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> * Update src/biz_bud/agents/rag_agent.py Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> * feat: add BaseCheckpointSaver interface documentation and enhance singleton pattern guidelines - Introduced new documentation for the BaseCheckpointSaver interface, detailing core methods for checkpoint management. - Updated check_singletons.md to include additional singleton patterns and best practices for resource management. - Enhanced error handling in create_research_graph to log failures when creating the Postgres checkpointer. --------- Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
66 lines
1.5 KiB
Docker
66 lines
1.5 KiB
Docker
# Production Dockerfile for Business Buddy FastAPI with LangGraph
|
|
FROM python:3.12-slim
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
TZ=UTC
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
curl \
|
|
git \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install UV package manager
|
|
RUN pip install --no-cache-dir uv
|
|
|
|
# Install Node.js (required for some LangGraph features)
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
|
|
&& apt-get install -y nodejs \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install LangGraph CLI
|
|
RUN pip install --no-cache-dir langgraph-cli
|
|
|
|
# Create app user
|
|
RUN useradd --create-home --shell /bin/bash app
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy dependency files
|
|
COPY pyproject.toml uv.lock ./
|
|
COPY packages/ ./packages/
|
|
|
|
# Install Python dependencies
|
|
RUN uv sync --frozen --no-dev
|
|
|
|
# Copy application code
|
|
COPY src/ ./src/
|
|
COPY langgraph.json config.yaml ./
|
|
# Remove this line - use environment variables or runtime secrets instead
|
|
|
|
# Set proper ownership
|
|
RUN chown -R app:app /app
|
|
|
|
# Switch to app user
|
|
USER app
|
|
|
|
# Create directories for logs and data
|
|
RUN mkdir -p /app/logs /app/data
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:8000/health || exit 1
|
|
|
|
# Set the entrypoint to use LangGraph CLI
|
|
ENTRYPOINT ["langgraph", "up", "--host", "0.0.0.0", "--port", "8000"]
|