Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -0
Dockerfile
CHANGED
@@ -18,6 +18,14 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
18 |
# Copy the application code
|
19 |
COPY main.py .
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
# Expose the port (Hugging Face Spaces expects 7860)
|
22 |
EXPOSE 7860
|
23 |
|
|
|
18 |
# Copy the application code
|
19 |
COPY main.py .
|
20 |
|
21 |
+
# Create a non-root user and set permissions
|
22 |
+
RUN useradd -m -u 1000 appuser \
|
23 |
+
&& mkdir -p /app/.cache \
|
24 |
+
&& chown -R appuser:appuser /app
|
25 |
+
|
26 |
+
# Switch to the non-root user
|
27 |
+
USER appuser
|
28 |
+
|
29 |
# Expose the port (Hugging Face Spaces expects 7860)
|
30 |
EXPOSE 7860
|
31 |
|