Spaces:
Sleeping
Sleeping
| # Dockerfile | |
| FROM python:3.10-slim | |
| # Lib cần cho OpenCV & hiệu năng | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libglib2.0-0 libsm6 libxext6 libxrender1 libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY api.py inference.py ./ | |
| COPY models ./models | |
| # Spaces đặt PORT (thường 7860). Uvicorn nghe host 0.0.0.0 | |
| ENV HOST=0.0.0.0 | |
| EXPOSE 7860 | |
| CMD ["sh", "-c", "uvicorn api:app --host ${HOST} --port ${PORT:-7860}"] | |