jarif's picture
Update Dockerfile
a47ea63 verified
raw
history blame contribute delete
861 Bytes
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
# πŸ‘‰ CRITICAL: Set HOME to writable location
ENV HOME=/tmp
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY src/ ./src/
# Expose port
EXPOSE 8501
# Health check
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Streamlit run command with XSRF protection disabled to fix upload issues in Docker
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.address=0.0.0.0", "--server.port=8501", "--server.enableXsrfProtection=false"]