Spaces:
Running
Running
Fix cache permissions on Hugging Face Spaces
Browse files- 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
|