Spaces:
Runtime error
Runtime error
samlam111
commited on
Commit
·
5b9a0a5
1
Parent(s):
b7c86a5
Attempt
Browse files- Dockerfile +10 -2
Dockerfile
CHANGED
@@ -10,14 +10,22 @@ RUN apt-get update && apt-get install -y \
|
|
10 |
git \
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
# Copy requirements first to leverage Docker cache
|
14 |
-
COPY requirements.txt .
|
15 |
|
16 |
# Install Python dependencies
|
17 |
RUN pip install --no-cache-dir -r requirements.txt
|
18 |
|
19 |
# Copy the rest of the application
|
20 |
-
COPY . .
|
21 |
|
22 |
# Expose the port Gradio will run on
|
23 |
EXPOSE 7860
|
|
|
10 |
git \
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# Create a non-root user and set up directories
|
14 |
+
RUN useradd -m -u 1000 user \
|
15 |
+
&& mkdir -p /app/.cache \
|
16 |
+
&& chown -R user:user /app
|
17 |
+
|
18 |
+
# Switch to non-root user
|
19 |
+
USER user
|
20 |
+
|
21 |
# Copy requirements first to leverage Docker cache
|
22 |
+
COPY --chown=user:user requirements.txt .
|
23 |
|
24 |
# Install Python dependencies
|
25 |
RUN pip install --no-cache-dir -r requirements.txt
|
26 |
|
27 |
# Copy the rest of the application
|
28 |
+
COPY --chown=user:user . .
|
29 |
|
30 |
# Expose the port Gradio will run on
|
31 |
EXPOSE 7860
|