FROM python:3.11-slim COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ # ติดตั้ง System Dependencies สำหรับ OpenCV และการประมวลผลรูปภาพ RUN apt-get update && apt-get install -y --no-install-recommends \ libgl1 \ libglib2.0-0 \ libxcb1 \ libx11-6 \ libsm6 \ libxext6 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* WORKDIR /code ENV UV_PYTHON=python3.11 COPY pyproject.toml uv.lock ./ RUN uv sync --frozen --no-dev COPY . /code ENV PATH="/code/.venv/bin:$PATH" CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--access-log", "--log-level", "info"]