Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -1
Dockerfile
CHANGED
@@ -3,6 +3,13 @@ FROM python:3.10
|
|
3 |
# Set the working directory
|
4 |
WORKDIR /app
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
# Copy and install dependencies
|
7 |
COPY requirements.txt .
|
8 |
RUN pip install --no-cache-dir -r requirements.txt
|
@@ -17,4 +24,4 @@ RUN mkdir -p /app/models_cache && chmod -R 777 /app/models_cache
|
|
17 |
EXPOSE 7860
|
18 |
|
19 |
# Run the FastAPI application with Uvicorn
|
20 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
3 |
# Set the working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Set environment variables for Hugging Face cache location
|
7 |
+
ENV TRANSFORMERS_CACHE=/app/models_cache
|
8 |
+
ENV HF_HOME=/app/models_cache
|
9 |
+
ENV HF_DATASETS_CACHE=/app/models_cache
|
10 |
+
ENV SENTENCE_TRANSFORMERS_HOME=/app/models_cache
|
11 |
+
ENV XDG_CACHE_HOME=/app/models_cache
|
12 |
+
|
13 |
# Copy and install dependencies
|
14 |
COPY requirements.txt .
|
15 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
24 |
EXPOSE 7860
|
25 |
|
26 |
# Run the FastAPI application with Uvicorn
|
27 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|