Spaces:
Build error
Build error
| # ---- Build stage ---- | |
| FROM python:3.11-slim AS build | |
| WORKDIR /app | |
| # Install build dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| git \ | |
| curl \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Upgrade pip | |
| RUN pip install --upgrade pip | |
| # Copy requirements | |
| COPY requirements.txt ./ | |
| # Install dependencies into a temporary directory | |
| RUN pip install --prefix=/install -r requirements.txt | |
| # Copy application code | |
| COPY src/ ./src/ | |
| # ---- Runtime stage ---- | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install runtime dependencies only | |
| RUN apt-get update && apt-get install -y libgomp1 curl git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy installed Python packages from build stage | |
| COPY --from=build /install /usr/local | |
| # Copy application code | |
| COPY --from=build /app/src ./src | |
| # Expose Streamlit port | |
| EXPOSE 8501 | |
| # Healthcheck | |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 | |
| # Entry point | |
| ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |