Download Dockerfile from euler314/magic-pdf: direct link, hf CLI and curl.
- Browser
- Download file 882 Bytes
-
https://huggingface.co/spaces/euler314/magic-pdf/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/euler314/magic-pdf/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/euler314/magic-pdf/resolve/main/Dockerfile
882 Bytes
| # 1. Start from the official Hugging Face Spaces base | |
| FROM public.ecr.aws/huggingface/transformers-pytorch-cpu:latest | |
| # 2. Force HOME to the user dir that runs the app | |
| ENV HOME=/home/user | |
| # 3. Set the working directory under that home | |
| WORKDIR $HOME/app | |
| # 4. Copy code & deps spec | |
| COPY . $HOME/app | |
| COPY requirements.txt $HOME/app/requirements.txt | |
| # 5. Install everything | |
| RUN pip install --upgrade pip \ | |
| && pip install -r requirements.txt \ | |
| && pip install huggingface_hub | |
| # 6. Download all Magic-PDF models AND emit your magic-pdf.json into $HOME | |
| RUN wget -q https://raw.githubusercontent.com/Whth/Magic-PDF/master/scripts/download_models_hf.py -O download_models_hf.py \ | |
| && python download_models_hf.py \ | |
| && mv magic-pdf.json $HOME/ \ | |
| && rm download_models_hf.py | |
| # 7. Expose Gradioβs default port | |
| EXPOSE 7860 | |
| # 8. Launch the app | |
| CMD ["python", "app.py"] | |