jskswamy's picture
Upload Dockerfile with huggingface_hub
3439f25 verified
raw
history blame contribute delete
665 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies (curl for health check)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY app.py .
# HuggingFace Spaces expects port 7860
EXPOSE 7860
# Health check
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
# Run Streamlit on port 7860 (HuggingFace Spaces requirement)
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]