Spaces:
Sleeping
Sleeping
# syntax=docker/dockerfile:1 | |
FROM python:3.10-slim | |
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \ | |
PYTHONDONTWRITEBYTECODE=1 \ | |
PYTHONUNBUFFERED=1 | |
# System deps | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential git curl && \ | |
rm -rf /var/lib/apt/lists/* | |
WORKDIR /app | |
# Install deps first for better caching | |
COPY requirements.txt /app/ | |
RUN pip install --upgrade pip && pip install -r requirements.txt | |
# Copy source | |
COPY . /app | |
# Hugging Face Spaces typically expose $PORT; default to 7860 for local runs | |
ENV PORT=7860 | |
EXPOSE 7860 | |
HEALTHCHECK --interval=10s --timeout=3s --start-period=20s --retries=3 \ | |
CMD curl -fsS "http://127.0.0.1:${PORT}/" || exit 1 | |
CMD bash -lc "streamlit run frontend.py --server.address=0.0.0.0 --server.port=$PORT" | |