Update Dockerfile
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
@@ -17,6 +17,10 @@ COPY requirements.txt .
|
|
17 |
RUN pip install --no-cache-dir --upgrade pip
|
18 |
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
|
|
|
|
|
|
|
|
|
20 |
# Download NLTK data (if needed)
|
21 |
RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data')"
|
22 |
|
@@ -26,10 +30,12 @@ COPY . .
|
|
26 |
# Create necessary directories
|
27 |
RUN mkdir -p /app/data/chunks /app/data/summaries /app/data/vectorstore
|
28 |
|
29 |
-
# Set environment variables
|
30 |
ENV PYTHONPATH=/app
|
31 |
ENV NLTK_DATA=/app/nltk_data
|
32 |
-
ENV HF_HOME=/
|
|
|
|
|
33 |
|
34 |
# Expose port
|
35 |
EXPOSE 7860
|
|
|
17 |
RUN pip install --no-cache-dir --upgrade pip
|
18 |
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
|
20 |
+
# Create cache directories with proper permissions
|
21 |
+
RUN mkdir -p /tmp/huggingface_cache /tmp/transformers_cache /app/nltk_data
|
22 |
+
RUN chmod 777 /tmp/huggingface_cache /tmp/transformers_cache
|
23 |
+
|
24 |
# Download NLTK data (if needed)
|
25 |
RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data')"
|
26 |
|
|
|
30 |
# Create necessary directories
|
31 |
RUN mkdir -p /app/data/chunks /app/data/summaries /app/data/vectorstore
|
32 |
|
33 |
+
# Set environment variables for cache directories
|
34 |
ENV PYTHONPATH=/app
|
35 |
ENV NLTK_DATA=/app/nltk_data
|
36 |
+
ENV HF_HOME=/tmp/huggingface_cache
|
37 |
+
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
|
38 |
+
ENV HF_DATASETS_CACHE=/tmp/huggingface_cache
|
39 |
|
40 |
# Expose port
|
41 |
EXPOSE 7860
|