FROM python:3.9-slim WORKDIR /app RUN apt-get update && apt-get install -y \ build-essential \ curl \ software-properties-common \ git \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt ./ COPY . ./ RUN pip3 install -r requirements.txt EXPOSE 8501 HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] # Create a writable config directory RUN mkdir -p /tmp/.streamlit # Set environment variables to redirect Streamlit's config path ENV STREAMLIT_HOME=/tmp/.streamlit ENV XDG_CONFIG_HOME=/tmp/.streamlit ENV BROWSER_GATHER_USAGE_STATS=false # Optional: disable telemetry explicitly RUN echo "[browser]\ngatherUsageStats = false" > /tmp/.streamlit/config.toml # Set up .streamlit path permissions and force ownership RUN mkdir -p /.streamlit && chmod -R 777 /.streamlit