check
Browse files- Dockerfile +12 -3
Dockerfile
CHANGED
@@ -3,6 +3,15 @@
|
|
3 |
|
4 |
FROM python:3.9
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
WORKDIR /code
|
7 |
|
8 |
COPY ./requirements.txt /code/requirements.txt
|
@@ -13,10 +22,10 @@ COPY . .
|
|
13 |
|
14 |
# RUN mkdir -p /cache
|
15 |
### Update permissions for the app
|
16 |
-
USER root
|
17 |
# RUN chmod 777 $PWD
|
18 |
-
RUN chmod 777 /
|
19 |
-
USER user
|
20 |
|
21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
22 |
# CMD [ "python", "app.py" ]
|
|
|
3 |
|
4 |
FROM python:3.9
|
5 |
|
6 |
+
### Set up user with permissions
|
7 |
+
# Set up a new user named "user" with user ID 1000
|
8 |
+
RUN useradd -m -u 1000 user
|
9 |
+
|
10 |
+
# Switch to the "user" user
|
11 |
+
USER user
|
12 |
+
|
13 |
+
RUN mkdir -p /code
|
14 |
+
|
15 |
WORKDIR /code
|
16 |
|
17 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
22 |
|
23 |
# RUN mkdir -p /cache
|
24 |
### Update permissions for the app
|
25 |
+
# USER root
|
26 |
# RUN chmod 777 $PWD
|
27 |
+
# RUN chmod 777 /
|
28 |
+
# USER user
|
29 |
|
30 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
31 |
# CMD [ "python", "app.py" ]
|