# Use a slim Python 3.10 base image | |
FROM python:3.10-slim | |
# Set environment variables | |
ENV PYTHONDONTWRITEBYTECODE=1 \ | |
PYTHONUNBUFFERED=1 | |
# Set the working directory | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
gcc \ | |
libglib2.0-0 \ | |
libsm6 \ | |
libxext6 \ | |
libxrender-dev \ | |
&& apt-get clean && rm -rf /var/lib/apt/lists/* | |
# Copy and install Python dependencies | |
COPY requirements.txt . | |
RUN pip install --upgrade pip && \ | |
pip install --no-cache-dir -r requirements.txt | |
# Copy the backend and frontend source code | |
COPY Backend/ Backend | |
COPY Frontend/ Frontend | |
# Expose FastAPI app on port 7860 (required by Hugging Face) | |
CMD ["uvicorn", "Backend.app:app", "--host", "0.0.0.0", "--port", "7860", "--limit-max-requests", "10000000"] | |