Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +6 -4
Dockerfile
CHANGED
@@ -1,17 +1,19 @@
|
|
1 |
-
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
-
#
|
|
|
5 |
WORKDIR /app
|
|
|
|
|
6 |
|
7 |
# Copy the requirements file into the container
|
8 |
-
COPY requirements.txt .
|
9 |
|
10 |
# Install any needed packages specified in requirements.txt
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
# Copy the current directory contents into the container
|
14 |
-
COPY . .
|
15 |
|
16 |
# Expose port 7860 (default port for Gradio)
|
17 |
EXPOSE 7860
|
|
|
|
|
1 |
FROM python:3.9-slim
|
2 |
|
3 |
+
# Create a non-root user and switch to it
|
4 |
+
RUN useradd -m appuser
|
5 |
WORKDIR /app
|
6 |
+
RUN chown appuser:appuser /app
|
7 |
+
USER appuser
|
8 |
|
9 |
# Copy the requirements file into the container
|
10 |
+
COPY --chown=appuser:appuser requirements.txt .
|
11 |
|
12 |
# Install any needed packages specified in requirements.txt
|
13 |
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
# Copy the current directory contents into the container
|
16 |
+
COPY --chown=appuser:appuser . .
|
17 |
|
18 |
# Expose port 7860 (default port for Gradio)
|
19 |
EXPOSE 7860
|