InsuCompass-v2.0 / Dockerfile
nagur-shareef-shaik's picture
Updated Dockerfile
167d4d4
raw
history blame contribute delete
948 Bytes
FROM python:3.10-slim
WORKDIR /app
# Set Streamlit config directory to a writable location
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy application files
COPY requirements.txt ./
COPY app.py ./
COPY assets ./assets
# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
# Create .streamlit directory, set permissions, and disable usage stats
RUN mkdir -p /app/.streamlit && \
chown -R 1000:1000 /app && \
chmod -R u+rw /app/.streamlit && \
echo "[browser]\ngatherUsageStats = false" > /app/.streamlit/config.toml
# Run as non-root user
USER 1000:1000
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"]