sagar008's picture
Update Dockerfile
c8669e0 verified
raw
history blame
1.31 kB
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements
COPY requirements.txt .
# Install dependencies with explicit plugin prevention
RUN pip install --no-cache-dir --upgrade pip
# ⚠️ CRITICAL: Install pinecone first WITHOUT deprecated plugins
RUN pip install --no-cache-dir "pinecone>=3.0.0"
# Explicitly prevent deprecated plugins from being installed
RUN pip install --no-cache-dir -r requirements.txt
# Force removal of any deprecated plugins that may have snuck in
RUN pip uninstall pinecone-plugin-inference pinecone-plugin-records pinecone-plugin-assistant -y || true
# Verify the main pinecone package is still installed
RUN pip show pinecone
# Create cache directories
RUN mkdir -p /tmp/huggingface_cache /tmp/transformers_cache /app/nltk_data
RUN chmod 777 /tmp/huggingface_cache /tmp/transformers_cache
# Download NLTK data
RUN python -c "import nltk; nltk.download('punkt', download_dir='/app/nltk_data')"
# Copy application code
COPY . .
# Set environment variables
ENV PYTHONPATH=/app
ENV NLTK_DATA=/app/nltk_data
ENV HF_HOME=/tmp/huggingface_cache
ENV TRANSFORMERS_CACHE=/tmp/transformers_cache
EXPOSE 7860
CMD ["python", "main.py"]