# Use official lightweight Python image FROM python:3.11-slim # Prevent interactive prompts during package installation ENV DEBIAN_FRONTEND=noninteractive # Install TeX Live (LaTeX) for PDF compilation RUN apt-get update && apt-get install -y \ texlive-latex-base \ texlive-fonts-recommended \ texlive-fonts-extra \ texlive-latex-extra \ && rm -rf /var/lib/apt/lists/* # Set up the working directory inside the container WORKDIR /app # Copy dependencies list and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application files COPY . . # Expose port 7860 (Standard for Hugging Face Spaces) EXPOSE 7860 # Run the FastAPI server via Uvicorn CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]