Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +10 -6
Dockerfile
CHANGED
@@ -1,21 +1,25 @@
|
|
1 |
# β
Use an official lightweight Python image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
# β
Set environment variables
|
5 |
-
ENV
|
|
|
6 |
|
7 |
-
# β
Set working directory
|
8 |
WORKDIR /app
|
9 |
|
10 |
-
# β
Copy
|
11 |
COPY requirements.txt .
|
12 |
COPY app.py .
|
13 |
|
14 |
# β
Install dependencies
|
15 |
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
|
17 |
-
# β
|
|
|
|
|
|
|
18 |
EXPOSE 7860
|
19 |
|
20 |
-
# β
|
21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
# β
Use an official lightweight Python image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# β
Set environment variables
|
5 |
+
ENV TRANSFORMERS_CACHE=/app/cache
|
6 |
+
ENV HF_HOME=/app/cache
|
7 |
|
8 |
+
# β
Set working directory
|
9 |
WORKDIR /app
|
10 |
|
11 |
+
# β
Copy files
|
12 |
COPY requirements.txt .
|
13 |
COPY app.py .
|
14 |
|
15 |
# β
Install dependencies
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# β
Create cache folder & set permissions
|
19 |
+
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
20 |
+
|
21 |
+
# β
Expose FastAPI port
|
22 |
EXPOSE 7860
|
23 |
|
24 |
+
# β
Run FastAPI
|
25 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|