Create Dockerfile
Browse files- Dockerfile +25 -0
Dockerfile
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official HF Spaces base (CPU or GPU as needed)
|
2 |
+
FROM public.ecr.aws/huggingface/transformers-pytorch-cpu:latest
|
3 |
+
|
4 |
+
# Set working dir
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy your code & requirements
|
8 |
+
COPY . .
|
9 |
+
|
10 |
+
# Install Python deps
|
11 |
+
RUN pip install --upgrade pip \
|
12 |
+
&& pip install -r requirements.txt \
|
13 |
+
&& pip install huggingface_hub
|
14 |
+
|
15 |
+
# Download Magic-PDF models & write config
|
16 |
+
RUN wget -q https://raw.githubusercontent.com/Whth/Magic-PDF/master/scripts/download_models_hf.py -O download_models_hf.py \
|
17 |
+
&& python download_models_hf.py \
|
18 |
+
&& mv magic-pdf.json /home/user/ \
|
19 |
+
&& rm download_models_hf.py
|
20 |
+
|
21 |
+
# Expose Gradio port
|
22 |
+
EXPOSE 7860
|
23 |
+
|
24 |
+
# Launch your app
|
25 |
+
CMD ["python", "app.py"]
|