ALYYAN's picture
Update Dockerfile
11ad9da verified
raw
history blame
735 Bytes
FROM python:3.11-slim
# Environment
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV STREAMLIT_SERVER_HEADLESS=true
# System dependencies (needed for OpenCV, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 curl \
&& rm -rf /var/lib/apt/lists/*
# Workdir
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy source
COPY . .
# Hugging Face expects port 7860
EXPOSE 7860
# Healthcheck (use the right port!)
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
# Launch Streamlit on 7860
ENTRYPOINT ["python", "-m", "streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]