SignLanguage / Dockerfile
thienphuc12339's picture
Add all source code
9f83ce9
raw
history blame contribute delete
816 Bytes
FROM python:3.10-slim
# Tắt buffering để log ra terminal ngay lập tức
ENV PYTHONUNBUFFERED=1
# Cài đặt các thư viện hệ thống cần thiết
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Sao chép requirements.txt vào container và cài đặt
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Sao chép toàn bộ code vào container
COPY . .
# Thiết lập biến môi trường PORT (Hugging Face sẽ trỏ traffic vào port này)
ENV PORT 7860
EXPOSE 7860
# Chạy ứng dụng FastAPI bằng uvicorn
# Ở đây giả sử file main app của bạn là app.py và app là tên biến FastAPI instance
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]