Update Dockerfile
Browse files- Dockerfile +24 -5
Dockerfile
CHANGED
@@ -12,11 +12,32 @@ RUN apt-get update && apt-get install -y \
|
|
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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|
@@ -26,7 +47,7 @@ RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data'
|
|
26 |
# Copy application code
|
27 |
COPY . .
|
28 |
|
29 |
-
#
|
30 |
ENV PYTHONPATH=/app
|
31 |
ENV NLTK_DATA=/app/nltk_data
|
32 |
ENV HF_HOME=/tmp/huggingface_cache
|
@@ -38,5 +59,3 @@ ENV TORCH_HOME=/tmp/torch_cache
|
|
38 |
EXPOSE 7860
|
39 |
|
40 |
CMD ["python", "main.py"]
|
41 |
-
|
42 |
-
|
|
|
12 |
# Copy requirements
|
13 |
COPY requirements.txt .
|
14 |
|
15 |
+
# Install dependencies with AGGRESSIVE plugin prevention
|
16 |
RUN pip install --no-cache-dir --upgrade pip
|
17 |
+
|
18 |
+
# STEP 1: Remove any existing pinecone packages and plugins
|
19 |
+
RUN pip uninstall pinecone pinecone-client pinecone-plugin-inference pinecone-plugin-records pinecone-plugin-assistant -y || true
|
20 |
+
|
21 |
+
# STEP 2: Clear pip cache to ensure clean install
|
22 |
+
RUN pip cache purge
|
23 |
+
|
24 |
+
# STEP 3: Install pinecone FIRST without any other packages
|
25 |
+
RUN pip install --no-cache-dir "pinecone>=3.0.0"
|
26 |
+
|
27 |
+
# STEP 4: Verify pinecone is installed correctly
|
28 |
+
RUN python -c "import pinecone; print('✅ Pinecone imported successfully')"
|
29 |
+
|
30 |
+
# STEP 5: Install remaining requirements
|
31 |
RUN pip install --no-cache-dir -r requirements.txt
|
32 |
|
33 |
+
# STEP 6: AGGRESSIVELY remove deprecated plugins that may have been pulled in
|
34 |
+
RUN pip uninstall pinecone-plugin-inference pinecone-plugin-records pinecone-plugin-assistant -y || true
|
35 |
+
|
36 |
+
# STEP 7: Final verification
|
37 |
+
RUN python -c "import pinecone; print('✅ Final pinecone check passed')" || \
|
38 |
+
(echo "❌ Pinecone import failed - listing installed packages:" && pip list | grep pinecone)
|
39 |
+
|
40 |
+
# Create cache directories with proper permissions for HF Spaces
|
41 |
RUN mkdir -p /tmp/huggingface_cache /tmp/transformers_cache /tmp/sentence_transformers_cache /app/nltk_data
|
42 |
RUN chmod 777 /tmp/huggingface_cache /tmp/transformers_cache /tmp/sentence_transformers_cache
|
43 |
|
|
|
47 |
# Copy application code
|
48 |
COPY . .
|
49 |
|
50 |
+
# Set cache environment variables for HF Spaces
|
51 |
ENV PYTHONPATH=/app
|
52 |
ENV NLTK_DATA=/app/nltk_data
|
53 |
ENV HF_HOME=/tmp/huggingface_cache
|
|
|
59 |
EXPOSE 7860
|
60 |
|
61 |
CMD ["python", "main.py"]
|
|
|
|