Spaces:
Sleeping
Sleeping
File size: 454 Bytes
9b816ef 71f6ce8 9b816ef | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | FROM python:3.11-slim
WORKDIR /app
# Cache dependency layer riêng
COPY api_requirements.txt .
RUN pip install --no-cache-dir -r api_requirements.txt
# Copy toàn bộ src/ vào /app/src/ để giữ nguyên "from src.xxx" import paths
COPY . ./src/
# Thư mục fallback khi Redis không kết nối được
RUN mkdir -p /app/data
# HF Spaces yêu cầu port 7860
EXPOSE 7860
CMD ["uvicorn", "src.api:app", "--host", "0.0.0.0", "--port", "7860"]
|