Spaces:
Sleeping
Sleeping
| # Sử dụng image Python làm base | |
| FROM python:3.10-slim | |
| # Thiết lập thư mục làm việc | |
| WORKDIR /app | |
| # Cài đặt các system dependencies nếu cần (tuỳ chọn) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy file requirements và cài đặt | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy toàn bộ mã nguồn vào container | |
| COPY . /app | |
| # Expose port (Hugging Face Spaces dùng 7860) | |
| EXPOSE 7860 | |
| # CMD để start FastAPI bằng Uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |