Abhishek commited on
Commit
c820a30
·
1 Parent(s): 0ebec80

fix: create /data with correct permissions before downloading

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -0
Dockerfile CHANGED
@@ -26,6 +26,9 @@ COPY --chown=user . /app
26
  ARG HF_TOKEN
27
  ENV HF_TOKEN=${HF_TOKEN}
28
  RUN pip install huggingface_hub hf_transfer
 
 
 
29
  RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=false \
30
  if [ -f /run/secrets/HF_TOKEN ]; then export HF_TOKEN=$(cat /run/secrets/HF_TOKEN); fi && \
31
  python scripts/download_model.py black-forest-labs/FLUX.2-klein-base-4B /data/FLUX.2-klein-base-4B && \
 
26
  ARG HF_TOKEN
27
  ENV HF_TOKEN=${HF_TOKEN}
28
  RUN pip install huggingface_hub hf_transfer
29
+ USER root
30
+ RUN mkdir -p /data && chown -R user:user /data
31
+ USER user
32
  RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=false \
33
  if [ -f /run/secrets/HF_TOKEN ]; then export HF_TOKEN=$(cat /run/secrets/HF_TOKEN); fi && \
34
  python scripts/download_model.py black-forest-labs/FLUX.2-klein-base-4B /data/FLUX.2-klein-base-4B && \