Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +16 -2
Dockerfile
CHANGED
@@ -1,8 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Use an official Python runtime as a parent image
|
2 |
FROM python:3.9.19
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
-
WORKDIR /app
|
6 |
|
7 |
# Copy the current directory contents into the container at /app
|
8 |
COPY . /app
|
@@ -14,4 +26,6 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
14 |
EXPOSE 5500
|
15 |
|
16 |
# Run app.py when the container launches
|
17 |
-
CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "5500"]
|
|
|
|
|
|
1 |
+
# Set up a new user named "user" with user ID 1000
|
2 |
+
RUN useradd -m -u 1000 user
|
3 |
+
|
4 |
+
# Switch to the "user" user
|
5 |
+
USER user
|
6 |
+
|
7 |
+
# Set home to the user's home directory
|
8 |
+
ENV HOME=/home/user \
|
9 |
+
PATH=/home/user/.local/bin:$PATH
|
10 |
+
|
11 |
+
# Set the working directory to the user's home directory
|
12 |
+
WORKDIR $HOME/app
|
13 |
+
|
14 |
# Use an official Python runtime as a parent image
|
15 |
FROM python:3.9.19
|
16 |
|
17 |
# Set the working directory in the container
|
|
|
18 |
|
19 |
# Copy the current directory contents into the container at /app
|
20 |
COPY . /app
|
|
|
26 |
EXPOSE 5500
|
27 |
|
28 |
# Run app.py when the container launches
|
29 |
+
CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "5500"]
|
30 |
+
|
31 |
+
|