Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +12 -0
Dockerfile
CHANGED
|
@@ -8,12 +8,24 @@ WORKDIR /app
|
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# Copy the model and code files
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
|
| 15 |
# Create directory for ChromaDB
|
| 16 |
RUN mkdir -p ./chroma_db
|
|
|
|
| 17 |
|
| 18 |
# Expose the port FastAPI will run on
|
| 19 |
EXPOSE 7860
|
|
|
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
|
| 12 |
+
# Create cache directories with proper permissions
|
| 13 |
+
RUN mkdir -p /app/cache/huggingface /app/cache/transformers /app/cache/sentence_transformers
|
| 14 |
+
RUN chmod -R 777 /app/cache
|
| 15 |
+
|
| 16 |
+
# Set environment variables for cache locations
|
| 17 |
+
ENV HF_HOME=/app/cache/huggingface
|
| 18 |
+
ENV TRANSFORMERS_CACHE=/app/cache/transformers
|
| 19 |
+
ENV SENTENCE_TRANSFORMERS_HOME=/app/cache/sentence_transformers
|
| 20 |
+
|
| 21 |
+
|
| 22 |
# Copy the model and code files
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
|
| 26 |
# Create directory for ChromaDB
|
| 27 |
RUN mkdir -p ./chroma_db
|
| 28 |
+
RUN chmod -R 777 ./chroma_db
|
| 29 |
|
| 30 |
# Expose the port FastAPI will run on
|
| 31 |
EXPOSE 7860
|