Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -5
Dockerfile
CHANGED
@@ -1,15 +1,22 @@
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
WORKDIR /app
|
4 |
-
RUN mkdir -p /app/cache
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
HF_DATASETS_CACHE=/app/cache \
|
9 |
XDG_CACHE_HOME=/app/cache
|
10 |
|
11 |
-
|
12 |
-
|
13 |
RUN pip install --no-cache-dir -r requirements.txt
|
14 |
|
|
|
|
|
|
|
|
|
15 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
WORKDIR /app
|
|
|
4 |
|
5 |
+
# Create a writable cache directory
|
6 |
+
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
7 |
+
|
8 |
+
# Set huggingface cache environment variables
|
9 |
+
ENV HF_HOME=/app/cache \
|
10 |
+
TRANSFORMERS_CACHE=/app/cache \
|
11 |
HF_DATASETS_CACHE=/app/cache \
|
12 |
XDG_CACHE_HOME=/app/cache
|
13 |
|
14 |
+
# Install Python dependencies
|
15 |
+
COPY requirements.txt .
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Copy your FastAPI app
|
19 |
+
COPY . .
|
20 |
+
|
21 |
+
# Run the FastAPI app
|
22 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|