Spaces:
Sleeping
Sleeping
Empereur-Pirate
commited on
Commit
•
284a4a3
1
Parent(s):
1bfee90
Update Dockerfile
Browse files- Dockerfile +16 -0
Dockerfile
CHANGED
@@ -11,4 +11,20 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
11 |
|
12 |
COPY . .
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
11 |
|
12 |
COPY . .
|
13 |
|
14 |
+
# Set up a new user named "user" with user ID 1000
|
15 |
+
RUN useradd -m -u 1000 user
|
16 |
+
|
17 |
+
# Switch to the "user" user
|
18 |
+
USER user
|
19 |
+
|
20 |
+
# Set home to the user's home directory
|
21 |
+
ENV HOME=/home/user \
|
22 |
+
PATH=/home/user/.local/bin:$PATH
|
23 |
+
|
24 |
+
# Set the working directory to the user's home directory
|
25 |
+
WORKDIR $HOME/app
|
26 |
+
|
27 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
28 |
+
COPY --chown=user . $HOME/app
|
29 |
+
|
30 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|