Rice_Quality / Dockerfile
CodeRuler's picture
Upload folder using huggingface_hub
0c0aca4 verified
Raw
History Blame Contribute Delete
638 Bytes
# Use a lightweight Python image
FROM python:3.11-slim
# Install system dependencies for OpenCV and YOLO
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy models and code
COPY runs/ /app/runs/
COPY main.py /app/main.py
COPY index.html /app/index.html
# Hugging Face Spaces expects the app to run on port 7860
EXPOSE 7860
# Start the API on port 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]