FROM python:3.10-slim # Cài đặt các thư viện hệ thống cần thiết RUN apt-get update && apt-get install -y \ git \ && rm -rf /var/lib/apt/lists/* # Tạo thư mục làm việc WORKDIR /app # Copy mã nguồn và cài đặt requirements COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . # Tạo thư mục cache có quyền ghi RUN mkdir -p /tmp/hf-cache && chmod -R 777 /tmp/hf-cache ENV TRANSFORMERS_CACHE=/tmp/hf-cache # Chạy server FastAPI CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]