markpeace commited on
Commit
36b5fc0
·
1 Parent(s): 2e9a633
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -1,16 +1,22 @@
1
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
5
 
6
- WORKDIR /code
7
 
8
- COPY ./requirements.txt /code/requirements.txt
 
 
 
9
 
10
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
11
 
12
- COPY . .
13
 
14
- #CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
15
 
16
- CMD ["python3", "app.py"]
 
 
 
 
 
1
+ FROM python:3.10
 
2
 
3
+ RUN apt-get update -y && apt-get install -y build-essential
4
 
5
+ WORKDIR /app
6
 
7
+ RUN useradd -m -u 1000 user
8
+ USER user
9
+ ENV HOME=/home/user \
10
+ PATH=/home/user/.local/bin:$PATH
11
 
12
+ WORKDIR $HOME/app
13
 
14
+ COPY --chown=user . $HOME/app
15
 
16
+ COPY app.py app.py
17
 
18
+ RUN pip install -r requirements.txt
19
+ #RUN pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cpu
20
+
21
+
22
+ CMD ["gunicorn","-b","0.0.0.0:7860", "app:app","--timeout","950"]