Spaces:
Runtime error
Runtime error
Download Dockerfile from thienphuc12339/SignLanguage: direct link, hf CLI and curl.
- Browser
- Download file 816 Bytes
-
https://huggingface.co/spaces/thienphuc12339/SignLanguage/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/thienphuc12339/SignLanguage/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/thienphuc12339/SignLanguage/resolve/main/Dockerfile
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"] | |