SQL_Chatbot / Dockerfile
Asif988's picture
Update Dockerfile
34974c3 verified
raw
history blame contribute delete
825 Bytes
# Base image
FROM python:3.12
# Set working directory
WORKDIR /app
# Copy everything into the container
COPY . /app
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Create writable cache directory
RUN mkdir -p /app/model_cache && chmod -R 777 /app/model_cache
# Preload model (optional but faster startup)
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('BAAI/bge-base-en-v1.5', cache_folder='/app/model_cache')"
# Set environment variables so your code uses the same cache
ENV HF_HOME=/app/model_cache
ENV TRANSFORMERS_CACHE=/app/model_cache
ENV SENTENCE_TRANSFORMERS_HOME=/app/model_cache
# Expose port for Streamlit
EXPOSE 7860
# Run the app
CMD ["streamlit", "run", "gemini_sql_rag_1_ext.py", "--server.port=7860", "--server.address=0.0.0.0"]