Spaces:
Sleeping
Sleeping
resolving permission error on hf
Browse files- Dockerfile +5 -2
Dockerfile
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
# Use Python 3.10 as the base image
|
2 |
FROM python:3.10-slim
|
|
|
3 |
|
|
|
|
|
4 |
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
@@ -8,13 +11,13 @@ WORKDIR /app
|
|
8 |
RUN pip install uv
|
9 |
|
10 |
# Copy requirements file
|
11 |
-
COPY requirements.txt .
|
12 |
|
13 |
# Install dependencies system-wide
|
14 |
RUN uv pip install --system -r requirements.txt
|
15 |
|
16 |
# Copy the application code
|
17 |
-
COPY . .
|
18 |
|
19 |
# Expose the port for Hugging Face Spaces (required)
|
20 |
EXPOSE 7860
|
|
|
1 |
# Use Python 3.10 as the base image
|
2 |
FROM python:3.10-slim
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
|
5 |
+
# Switch to the "user" user
|
6 |
+
USER user
|
7 |
# Set working directory
|
8 |
WORKDIR /app
|
9 |
|
|
|
11 |
RUN pip install uv
|
12 |
|
13 |
# Copy requirements file
|
14 |
+
COPY --chown=user requirements.txt .
|
15 |
|
16 |
# Install dependencies system-wide
|
17 |
RUN uv pip install --system -r requirements.txt
|
18 |
|
19 |
# Copy the application code
|
20 |
+
COPY --chown=user . .
|
21 |
|
22 |
# Expose the port for Hugging Face Spaces (required)
|
23 |
EXPOSE 7860
|