Spaces:
Runtime error
Runtime error
File size: 1,726 Bytes
cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 cf2c2d1 c6b26a7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# ============================================================
# 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"] |