ChessVision-OTB / Dockerfile
Lakshay545's picture
Migrate to Gunicorn and implement piece-detection safeguards
b06ae5c
Raw
History Blame Contribute Delete
752 Bytes
FROM python:3.10-slim
# Install system dependencies for OpenCV (headless version)
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements first to leverage Docker layer caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all repository files (includes dataset/models)
COPY . .
# Set environment variables for production execution
ENV PORT=7860
ENV HEADLESS=true
# Expose port (Hugging Face default)
EXPOSE 7860
# Run Flask using Gunicorn (production WSGI server)
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "120", "--chdir", "board finder.v1i.yolov11/chess", "server:app"]