# ── LaTeX Studio — HuggingFace Spaces Docker image ────────────────────────── FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 # ── System dependencies ─────────────────────────────────────────────────────── RUN apt-get update && apt-get install -y --no-install-recommends \ python3 python3-pip python3-dev \ lmodern \ texlive-latex-base \ texlive-latex-recommended \ texlive-latex-extra \ texlive-fonts-recommended \ texlive-fonts-extra \ texlive-pictures \ texlive-science \ texlive-xetex \ pandoc \ && apt-get clean && rm -rf /var/lib/apt/lists/* # ── Python dependencies ─────────────────────────────────────────────────────── WORKDIR /app COPY backend/requirements.txt /app/requirements.txt RUN pip3 install --no-cache-dir -r requirements.txt # ── Application files ───────────────────────────────────────────────────────── # Backend Python source COPY backend/ /app/ # Frontend HTML/CSS/JS (parent of /app/ → /frontend/) COPY frontend/ /frontend/ # LaTeX templates — use a no-space path inside /app/ to avoid Docker issues COPY ["latex templates/", "/app/latex_templates/"] # HuggingFace Spaces requires port 7860 EXPOSE 7860 # ── Launch ──────────────────────────────────────────────────────────────────── CMD ["python3", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]