anonymous13542's picture
Update Dockerfile
cf2c2d1 verified
# ============================================================
# Base image
# ============================================================
FROM python:3.13.5-slim
# Working directory
WORKDIR /app
# ============================================================
# System dependencies
# ============================================================
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# ============================================================
# Copy project files
# ============================================================
COPY requirements.txt ./
COPY src/ ./src/
COPY .streamlit/ ./src/.streamlit/
# ============================================================
# Install Python dependencies
# ============================================================
RUN pip install --no-cache-dir -r requirements.txt
# ============================================================
# Streamlit configuration (prevents permission errors)
# ============================================================
RUN mkdir -p /root/.streamlit
COPY .streamlit/config.toml /root/.streamlit/config.toml
# ============================================================
# Expose port and healthcheck
# ============================================================
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache
# ============================================================
# Launch Streamlit app
# ============================================================
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]