Download Dockerfile from doeqoth/export: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/doeqoth/export/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/doeqoth/export/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/doeqoth/export/resolve/main/Dockerfile
1.23 kB
| FROM python:3.10-slim | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| WORKDIR /home/user/app | |
| # System deps | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| wget curl git build-essential cmake pkg-config \ | |
| libcairo2-dev libpango1.0-dev libfreetype6-dev libglib2.0-dev \ | |
| libjpeg-dev libpng-dev libopenjp2-7-dev libtiff-dev libxml2-dev \ | |
| libpoppler-dev libpoppler-cpp-dev libpoppler-glib-dev poppler-utils \ | |
| fontforge \ | |
| fonts-dejavu fonts-liberation fonts-noto fonts-noto-cjk fonts-thai-tlwg \ | |
| && rm -rf /var/lib/apt/lists/* && apt-get clean | |
| # Build pdf2htmlEX from source | |
| RUN git clone --depth 1 https://github.com/pdf2htmlEX/pdf2htmlEX.git /tmp/pdf2htmlEX \ | |
| && cd /tmp/pdf2htmlEX \ | |
| && mkdir build && cd build \ | |
| && cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ | |
| && make -j"$(nproc)" \ | |
| && make install \ | |
| && rm -rf /tmp/pdf2htmlEX | |
| # Create non-root user | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Python deps | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # App code | |
| COPY --chown=user:user . . | |
| RUN mkdir -p /home/user/app/temp /home/user/app/output | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |