Spaces:
Runtime error
Runtime error
pengdaqian
commited on
Commit
•
7e04639
1
Parent(s):
c90d10a
fix
Browse files- Dockerfile +25 -0
- README.md +2 -3
Dockerfile
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.8
|
2 |
+
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
|
5 |
+
USER user
|
6 |
+
|
7 |
+
ENV HOME=/home/user \
|
8 |
+
PATH=/home/user/.local/bin:$PATH
|
9 |
+
|
10 |
+
COPY requirements.txt requirements.txt
|
11 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
RUN mkdir -p $HOME/app/cache/transformers
|
14 |
+
RUN chmod 777 $HOME/app/cache/transformers
|
15 |
+
|
16 |
+
ENV TRANSFORMERS_CACHE $HOME/app/cache/transformers
|
17 |
+
ENV HF_HOME $HOME/app/cache/transformers
|
18 |
+
|
19 |
+
WORKDIR $HOME/app
|
20 |
+
|
21 |
+
COPY --chown=user . $HOME/app
|
22 |
+
|
23 |
+
EXPOSE 7860
|
24 |
+
|
25 |
+
CMD ["sh", "-c", "python3 main.py"]
|
README.md
CHANGED
@@ -3,9 +3,8 @@ title: wqinir1
|
|
3 |
emoji: 🏃
|
4 |
colorFrom: pink
|
5 |
colorTo: blue
|
6 |
-
sdk:
|
7 |
-
|
8 |
-
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
---
|
|
|
3 |
emoji: 🏃
|
4 |
colorFrom: pink
|
5 |
colorTo: blue
|
6 |
+
sdk: docker
|
7 |
+
app_port: 7860
|
|
|
8 |
pinned: false
|
9 |
license: mit
|
10 |
---
|