alaajabari commited on
Commit
2a92f94
·
verified ·
1 Parent(s): 3b0f636

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -5
Dockerfile CHANGED
@@ -1,10 +1,22 @@
1
- FROM python:3.10-slim
2
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
7
 
8
- COPY . .
 
9
 
10
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
 
2
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
3
+ # you will also find guides on how best to write your Dockerfile
4
+
5
+ FROM python:3.9
6
+
7
+ # The two following lines are requirements for the Dev Mode to be functional
8
+ # Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
9
+ RUN useradd -m -u 1000 user
10
  WORKDIR /app
11
 
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ COPY --chown=user . /app
16
+
17
+ USER user
18
 
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH
21
 
22
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]