agent-from-scratch / Dockerfile
shekkari21's picture
fix agent error handling, add Dockerfile for HF Spaces
757a9cf
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy and install Python dependencies
COPY pyproject.toml .
RUN pip install --no-cache-dir \
fastapi>=0.100.0 \
litellm>=1.81.3 \
openai>=1.101.0 \
pydantic>=2.11.7 \
python-dotenv>=1.1.1 \
python-multipart>=0.0.6 \
uvicorn>=0.23.0 \
tavily-python>=0.7.11 \
openpyxl>=3.1.5 \
pandas>=2.3.3 \
pymupdf>=1.26.7 \
scikit-learn>=1.0.0 \
tqdm>=4.67.1 \
numpy \
mcp>=1.13.1 \
fastmcp>=2.11.3 \
tiktoken
# Copy application code
COPY agent_framework/ agent_framework/
COPY agent_tools/ agent_tools/
COPY rag/ rag/
COPY web_app/ web_app/
# HF Spaces runs on port 7860
EXPOSE 7860
CMD ["uvicorn", "web_app.app:app", "--host", "0.0.0.0", "--port", "7860"]