Spaces:
Sleeping
Sleeping
Download Dockerfile from Hztech/passport-extractor1: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/spaces/Hztech/passport-extractor1/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Hztech/passport-extractor1/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Hztech/passport-extractor1/resolve/main/Dockerfile
1.76 kB
| FROM python:3.10-slim | |
| # Set environment variables to suppress warnings | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONUNBUFFERED=1 | |
| # Set working directory | |
| WORKDIR /app | |
| # Step 1: Update sources and install essential build tools | |
| RUN if [ -f /etc/apt/sources.list ]; then \ | |
| sed -i 's/main$/main contrib non-free non-free-firmware/' /etc/apt/sources.list; \ | |
| fi && \ | |
| if [ -f /etc/apt/sources.list.d/debian.sources ]; then \ | |
| sed -i 's/Components: main/Components: main contrib non-free non-free-firmware/' /etc/apt/sources.list.d/debian.sources; \ | |
| fi && \ | |
| apt-get update -q && \ | |
| apt-get install -yq --no-install-recommends \ | |
| curl \ | |
| ca-certificates \ | |
| gnupg \ | |
| build-essential \ | |
| pkg-config && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Step 2: Install system dependencies for OCR and PDF processing | |
| COPY packages.txt /tmp/packages.txt | |
| RUN apt-get update -q && \ | |
| xargs -r -a /tmp/packages.txt apt-get install -yq --no-install-recommends || true && \ | |
| apt-get install -yq --no-install-recommends \ | |
| libgl1 \ | |
| poppler-utils \ | |
| tesseract-ocr \ | |
| tesseract-ocr-eng \ | |
| libtesseract-dev \ | |
| libleptonica-dev && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Step 3: Install Node.js | |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ | |
| apt-get install -yq nodejs && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Step 4: Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Step 5: Copy application code | |
| COPY . . | |
| # Step 6: Create models directory | |
| RUN mkdir -p data/models | |
| # Expose port 7860 | |
| EXPOSE 7860 | |
| # Run the application | |
| CMD ["python", "app.py"] | |