# Use a small Python base FROM python:3.11-slim # System deps required by OpenCV + pyzbar RUN apt-get update && apt-get install -y --no-install-recommends \ libgl1 \ libglib2.0-0 \ libzbar0 \ && rm -rf /var/lib/apt/lists/* # App folder WORKDIR /app # Install Python deps COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt # Copy app COPY app.py /app/ # For HF Spaces, your app must listen on $PORT (default 7860) ENV PORT=7860 EXPOSE 7860 # Start FastAPI with uvicorn; point to module:app CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port $PORT"]