Update Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132FROM python:3.10-slim# 1) Make /app your home directory so "~/.streamlit" → "/app/.streamlit"ENV HOME=/appWORKDIR /app# 2) Create the Streamlit config directory ahead of timeRUN mkdir -p $HOME/.streamlitRUN apt-get update && apt-get install -y \build-essential \curl \software-properties-common \git \&& rm -rf /var/lib/apt/lists/*COPY requirements.txt ./# Use latest pip to avoid old‐pip resolution bugsRUN pip install --upgrade pip \&& pip install --no-cache-dir -r requirements.txtCOPY src/ ./src/RUN pip3 install -r requirements.txtEXPOSE 8501HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/healthENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]12345678910111213141516171819202122232425262728293031FROM python:3.10-slim# Set the container home to /app so Streamlit writes configs under /app/.streamlitENV HOME=/appWORKDIR /app# Pre-create and set permissions on the Streamlit config directoryRUN mkdir -p $HOME/.streamlit \&& chmod 777 $HOME/.streamlit# Install system dependenciesRUN apt-get update && apt-get install -y \build-essential \curl \git \&& rm -rf /var/lib/apt/lists/*# Copy and install Python dependenciesCOPY requirements.txt ./RUN pip install --upgrade pip \&& pip install --no-cache-dir -r requirements.txt# Copy application source codeCOPY src/ ./src/# Expose Streamlit port and add a healthcheckEXPOSE 8501HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1# Launch the Streamlit appENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
Dockerfile+13-14