sagar008 commited on
Commit
c13415f
·
verified ·
1 Parent(s): 08df214

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -16
Dockerfile CHANGED
@@ -12,24 +12,13 @@ RUN apt-get update && apt-get install -y \
12
  # Copy requirements
13
  COPY requirements.txt .
14
 
15
- # Install dependencies with explicit plugin prevention
16
  RUN pip install --no-cache-dir --upgrade pip
17
-
18
- # ⚠️ CRITICAL: Install pinecone first WITHOUT deprecated plugins
19
- RUN pip install --no-cache-dir "pinecone>=3.0.0"
20
-
21
- # Explicitly prevent deprecated plugins from being installed
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # Force removal of any deprecated plugins that may have snuck in
25
- RUN pip uninstall pinecone-plugin-inference pinecone-plugin-records pinecone-plugin-assistant -y || true
26
-
27
- # Verify the main pinecone package is still installed
28
- RUN pip show pinecone
29
-
30
- # Create cache directories
31
- RUN mkdir -p /tmp/huggingface_cache /tmp/transformers_cache /app/nltk_data
32
- RUN chmod 777 /tmp/huggingface_cache /tmp/transformers_cache
33
 
34
  # Download NLTK data
35
  RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data')"
@@ -37,13 +26,17 @@ RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data'
37
  # Copy application code
38
  COPY . .
39
 
40
- # Set environment variables
41
  ENV PYTHONPATH=/app
42
  ENV NLTK_DATA=/app/nltk_data
43
  ENV HF_HOME=/tmp/huggingface_cache
44
  ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
 
 
 
45
 
46
  EXPOSE 7860
47
 
48
  CMD ["python", "main.py"]
49
 
 
 
12
  # Copy requirements
13
  COPY requirements.txt .
14
 
15
+ # Install dependencies
16
  RUN pip install --no-cache-dir --upgrade pip
 
 
 
 
 
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # CREATE CACHE DIRECTORIES WITH PROPER PERMISSIONS
20
+ RUN mkdir -p /tmp/huggingface_cache /tmp/transformers_cache /tmp/sentence_transformers_cache /app/nltk_data
21
+ RUN chmod 777 /tmp/huggingface_cache /tmp/transformers_cache /tmp/sentence_transformers_cache
 
 
 
 
 
 
22
 
23
  # Download NLTK data
24
  RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data')"
 
26
  # Copy application code
27
  COPY . .
28
 
29
+ # SET CACHE ENVIRONMENT VARIABLES FOR HF SPACES
30
  ENV PYTHONPATH=/app
31
  ENV NLTK_DATA=/app/nltk_data
32
  ENV HF_HOME=/tmp/huggingface_cache
33
  ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
34
+ ENV SENTENCE_TRANSFORMERS_HOME=/tmp/sentence_transformers_cache
35
+ ENV XDG_CACHE_HOME=/tmp
36
+ ENV TORCH_HOME=/tmp/torch_cache
37
 
38
  EXPOSE 7860
39
 
40
  CMD ["python", "main.py"]
41
 
42
+