File size: 600 Bytes
e40b198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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"]