File size: 882 Bytes
51a1606
464dbbd
 
51a1606
 
464dbbd
51a1606
 
464dbbd
51a1606
 
 
 
 
464dbbd
 
 
 
51a1606
464dbbd
 
51a1606
464dbbd
 
51a1606
464dbbd
 
51a1606
464dbbd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 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"]