navpan2 commited on
Commit
638bdd5
·
1 Parent(s): 5c18927

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -2
Dockerfile CHANGED
@@ -1,11 +1,15 @@
1
  FROM python:3.10
 
 
2
 
 
 
3
  WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
6
 
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
- COPY . .
10
 
11
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10
2
+ # Set up a new user named "user" with user ID 1000
3
+ RUN useradd -m -u 1000 user
4
 
5
+ # Switch to the "user" user
6
+ USER user
7
  WORKDIR /code
8
 
9
+ COPY --chown=user ./requirements.txt /code/requirements.txt
10
 
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
13
+ COPY --chown=user . .
14
 
15
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]