|
FROM python:3.11-slim |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
git \ |
|
wget \ |
|
curl \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip |
|
|
|
|
|
RUN pip uninstall pinecone pinecone-client pinecone-plugin-inference pinecone-plugin-records pinecone-plugin-assistant -y || true |
|
|
|
|
|
RUN pip cache purge |
|
|
|
|
|
RUN pip install --no-cache-dir "pinecone>=3.0.0" |
|
|
|
|
|
RUN python -c "import pinecone; print(' Pinecone imported successfully')" |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN pip uninstall pinecone-plugin-inference pinecone-plugin-records pinecone-plugin-assistant -y || true |
|
|
|
|
|
RUN python -c "import pinecone; print(' Final pinecone check passed')" || \ |
|
(echo " Pinecone import failed - listing installed packages:" && pip list | grep pinecone) |
|
|
|
|
|
RUN mkdir -p /tmp/huggingface_cache /tmp/transformers_cache /tmp/sentence_transformers_cache /app/nltk_data |
|
RUN chmod 777 /tmp/huggingface_cache /tmp/transformers_cache /tmp/sentence_transformers_cache |
|
|
|
|
|
RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data')" || true |
|
|
|
|
|
COPY . . |
|
|
|
|
|
ENV PYTHONPATH=/app |
|
ENV NLTK_DATA=/app/nltk_data |
|
ENV HF_HOME=/tmp/huggingface_cache |
|
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache |
|
ENV SENTENCE_TRANSFORMERS_HOME=/tmp/sentence_transformers_cache |
|
ENV XDG_CACHE_HOME=/tmp |
|
ENV TORCH_HOME=/tmp/torch_cache |
|
|
|
EXPOSE 7860 |
|
|
|
CMD ["python", "main.py"] |
|
|