Spaces:
Sleeping
Sleeping
Commit
·
1b38816
1
Parent(s):
76f1a7c
Fix: Create output dir with correct permissions before COPY
Browse files- Dockerfile +9 -4
Dockerfile
CHANGED
@@ -54,6 +54,10 @@ RUN wget https://github.com/opendatalab/MinerU/raw/master/scripts/download_model
|
|
54 |
wget https://github.com/opendatalab/MinerU/raw/master/magic-pdf.template.json -O $HOME/app/magic-pdf.json && \
|
55 |
chown user:user $HOME/app/download_models.py $HOME/app/magic-pdf.json
|
56 |
|
|
|
|
|
|
|
|
|
57 |
# Switch to user to run download script and copy app code
|
58 |
USER user
|
59 |
|
@@ -64,10 +68,11 @@ RUN . /opt/mineru_venv/bin/activate && \
|
|
64 |
sed -i 's|"device": "cpu"|"device": "cpu"|g' $HOME/magic-pdf.json
|
65 |
|
66 |
# Copy the rest of the application code as the user
|
67 |
-
|
|
|
68 |
|
69 |
-
#
|
70 |
-
#
|
71 |
-
RUN
|
72 |
|
73 |
CMD ["/opt/mineru_venv/bin/uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
54 |
wget https://github.com/opendatalab/MinerU/raw/master/magic-pdf.template.json -O $HOME/app/magic-pdf.json && \
|
55 |
chown user:user $HOME/app/download_models.py $HOME/app/magic-pdf.json
|
56 |
|
57 |
+
# Create output directory and set ownership BEFORE switching user for COPY
|
58 |
+
RUN mkdir -p $HOME/app/output/images && \
|
59 |
+
chown -R user:user $HOME/app/output
|
60 |
+
|
61 |
# Switch to user to run download script and copy app code
|
62 |
USER user
|
63 |
|
|
|
68 |
sed -i 's|"device": "cpu"|"device": "cpu"|g' $HOME/magic-pdf.json
|
69 |
|
70 |
# Copy the rest of the application code as the user
|
71 |
+
# This will copy into the WORKDIR ($HOME/app)
|
72 |
+
COPY --chown=user . .
|
73 |
|
74 |
+
# Ensure the output dir still has correct permissions after final copy
|
75 |
+
# (This might be redundant but can help in some cases)
|
76 |
+
RUN chmod -R 755 $HOME/app/output
|
77 |
|
78 |
CMD ["/opt/mineru_venv/bin/uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|