bot / Dockerfile
SuhasGholkar's picture
Update Dockerfile
ee50919 verified
Raw History Blame Contribute Delete
1.57 kB
# -----------------------------
# Base Image
# -----------------------------
FROM python:3.10-slim
# -----------------------------
# Set working directory
# -----------------------------
WORKDIR /app
# Cache to writable, persistent volume
ENV HF_HOME=/data/hf-cache \
HF_HUB_CACHE=/data/hf-cache/hub \
TRANSFORMERS_CACHE=/data/hf-cache/transformers \
HF_HUB_DISABLE_SYMLINKS_WARNING=1
RUN mkdir -p /data/hf-cache/hub /data/hf-cache/transformers
# -----------------------------
# Install system dependencies
# -----------------------------
RUN apt-get update && apt-get install -y \
build-essential \
libffi-dev \
sqlite3 \
&& rm -rf /var/lib/apt/lists/*
# -----------------------------
# Install Python dependencies
# -----------------------------
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Ensure data dir exists (mounted at runtime ideally)
RUN mkdir -p /data /data/rag_store
ENV RAG_BACKEND=CHROMA \
RAG_DIR=/data/rag_store \
RAG_COLLECTION=olist_sql_exemplars \
OPENAI_EMBED_MODEL=text-embedding-3-small
# -----------------------------
# Copy app files
# -----------------------------
COPY . .
# -----------------------------
# Ensure persistent storage dir
# -----------------------------
RUN mkdir -p /data
# -----------------------------
# Expose Streamlit Port
# -----------------------------
EXPOSE 7860
# -----------------------------
# Default run command
# -----------------------------
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]