Spaces:
Running
Running
FROM python:3.9-slim | |
WORKDIR /app | |
# Install LaTeX with comprehensive Chinese support | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
texlive-full \ | |
fonts-noto-cjk \ | |
fonts-noto-cjk-extra \ | |
fonts-wqy-microhei \ | |
fonts-wqy-zenhei \ | |
fonts-arphic-ukai \ | |
fonts-arphic-uming \ | |
fontconfig \ | |
&& fc-cache -fv \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Verify that all LaTeX engines are installed and in PATH | |
RUN which pdflatex && which xelatex && which lualatex || (echo "LaTeX engines not found in PATH" && exit 1) | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY app.py . | |
# Add a debugging script to check installation | |
RUN echo "#!/bin/bash\necho 'Checking LaTeX engines installation:'\necho 'pdflatex:' && which pdflatex && pdflatex --version | head -1\necho 'xelatex:' && which xelatex && xelatex --version | head -1\necho 'lualatex:' && which lualatex && lualatex --version | head -1\necho 'Available fonts:'\nfc-list | grep -i 'noto\\|wqy\\|arphic' | head -10" > /app/check_latex.sh && \ | |
chmod +x /app/check_latex.sh | |
EXPOSE 8501 | |
# Start with the debug script then run the application | |
CMD ["/bin/bash", "-c", "/app/check_latex.sh && streamlit run app.py --server.address=0.0.0.0"] |