Thiago Hersan
commited on
Commit
•
557384d
1
Parent(s):
7a544e3
pin fastapi version
Browse files- Dockerfile +16 -12
- requirements.txt +7 -6
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
FROM python:3.
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
@@ -10,20 +10,24 @@ RUN useradd -m -u 1000 user
|
|
10 |
|
11 |
USER user
|
12 |
|
13 |
-
|
14 |
-
PATH=/home/user/.local/bin:$PATH \
|
15 |
-
PYTHONPATH=$HOME/app \
|
16 |
-
PYTHONUNBUFFERED=1 \
|
17 |
-
GRADIO_ALLOW_FLAGGING=never \
|
18 |
-
GRADIO_NUM_PORTS=1 \
|
19 |
-
GRADIO_SERVER_NAME=0.0.0.0 \
|
20 |
-
GRADIO_THEME=huggingface \
|
21 |
-
SYSTEM=spaces \
|
22 |
-
HF_HOME=/home/user/data/.huggingface
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
|
|
|
|
25 |
WORKDIR $HOME/app
|
26 |
|
27 |
-
COPY --chown=user ./
|
|
|
28 |
|
29 |
CMD ["python", "app.py"]
|
|
|
1 |
+
FROM python:3.9.17
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
|
|
10 |
|
11 |
USER user
|
12 |
|
13 |
+
ARG HOME=/home/user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
ENV HOME=${HOME} \
|
16 |
+
PATH=${HOME}/.local/bin:$PATH \
|
17 |
+
PYTHONPATH=${HOME}/app \
|
18 |
+
PYTHONUNBUFFERED=1 \
|
19 |
+
GRADIO_ALLOW_FLAGGING=never \
|
20 |
+
GRADIO_NUM_PORTS=1 \
|
21 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
22 |
+
GRADIO_THEME=huggingface \
|
23 |
+
SYSTEM=spaces \
|
24 |
+
HF_HOME=${HOME}/data/.huggingface
|
25 |
|
26 |
+
|
27 |
+
RUN mkdir -p ${HOME}/app
|
28 |
WORKDIR $HOME/app
|
29 |
|
30 |
+
COPY --chown=user ./app.py $HOME/app/
|
31 |
+
COPY --chown=user ./examples $HOME/app/examples
|
32 |
|
33 |
CMD ["python", "app.py"]
|
requirements.txt
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
1 |
+
fastapi==0.89.0
|
2 |
+
gradio==3.23.0
|
3 |
+
Pillow
|
4 |
+
scipy
|
5 |
+
torch
|
6 |
+
torchvision
|
7 |
+
transformers
|