FROM python:3.13.5-slim WORKDIR /app RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ && rm -rf /var/lib/apt/lists/* # create a writable cache directory and make sure it's writable by the container process RUN mkdir -p /app/.cache && chmod 0777 /app/.cache RUN mkdir -p /app/.streamlit && chmod 0777 /app/.streamlit # Force all relevant libraries to use /app/.cache (writable inside the container) ENV HF_HOME=/app/.cache \ TRANSFORMERS_CACHE=/app/.cache \ SENTENCE_TRANSFORMERS_HOME=/app/.cache \ LLAMA_INDEX_CACHE_DIR=/app/.cache \ XDG_CACHE_HOME=/app/.cache\ STREAMLIT_CONFIG_DIR=/app/.streamlit \ STREAMLIT_CACHE_DIR=/app/.streamlit/cache # Copy files and install dependencies COPY requirements.txt ./ COPY . . RUN pip3 install --no-cache-dir -r requirements.txt EXPOSE 8501 HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]