Ekocak commited on
Commit
9758d80
·
1 Parent(s): 01bbe3d

Fix cache permissions on Hugging Face Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -0
Dockerfile CHANGED
@@ -6,9 +6,11 @@ FROM python:3.9-slim
6
 
7
  # Set the working directory inside the container.
8
  WORKDIR /code
 
9
 
10
  ENV HF_HOME=/code/.cache
11
 
 
12
  # IMPORTANT OPTIMIZATION:
13
  # First, copy and install only the dependency list.
14
  # This prevents reinstalling hundreds of MBs of libraries every time we change
 
6
 
7
  # Set the working directory inside the container.
8
  WORKDIR /code
9
+ RUN useradd --no-create-home --shell /bin/bash appuser
10
 
11
  ENV HF_HOME=/code/.cache
12
 
13
+ RUN mkdir -p /code/.cache && chown -R appuser:appuser /code/.cache
14
  # IMPORTANT OPTIMIZATION:
15
  # First, copy and install only the dependency list.
16
  # This prevents reinstalling hundreds of MBs of libraries every time we change