Spaces:
Runtime error
Runtime error
mahimairaja
commited on
Commit
•
45fda39
1
Parent(s):
30154e8
Update Dockerfile
Browse files- Dockerfile +16 -0
Dockerfile
CHANGED
@@ -1,5 +1,21 @@
|
|
1 |
FROM python:3.10.12
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
RUN pip install -r requirements.txt
|
4 |
|
5 |
CMD ["python", "app.py"]
|
|
|
1 |
FROM python:3.10.12
|
2 |
|
3 |
+
# Switch to the "user" user
|
4 |
+
USER user
|
5 |
+
|
6 |
+
# Set home to the user's home directory
|
7 |
+
ENV HOME=/home/user \
|
8 |
+
PATH=/home/user/.local/bin:$PATH
|
9 |
+
|
10 |
+
# Set the working directory to the user's home directory
|
11 |
+
WORKDIR $HOME/app
|
12 |
+
|
13 |
+
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
14 |
+
RUN pip install --no-cache-dir --upgrade pip
|
15 |
+
|
16 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
17 |
+
COPY --chown=user . $HOME/app
|
18 |
+
|
19 |
RUN pip install -r requirements.txt
|
20 |
|
21 |
CMD ["python", "app.py"]
|