Download Dockerfile from chrisnguyenx/EfficientNet-P3: direct link, hf CLI and curl.
- Browser
- Download file 845 Bytes
-
https://huggingface.co/chrisnguyenx/EfficientNet-P3/resolve/main/Dockerfile
- Command line
-
hf download hf://chrisnguyenx/EfficientNet-P3/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/chrisnguyenx/EfficientNet-P3/resolve/main/Dockerfile
845 Bytes
| # Use official Python 3.10 slim runtime | |
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Cài đặt các thư viện hệ thống cần thiết | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| libgomp1 \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Cài đặt PyTorch & Torchvision bản CPU siêu nhẹ (~150MB thay vì 2.5GB GPU) | |
| # Tránh tuyệt đối lỗi tràn bộ nhớ / Bus Error của Docker Desktop WSL2 | |
| RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
| # Copy requirements và cài đặt các thư viện còn lại | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy toàn bộ mã nguồn vào container | |
| COPY . . | |
| EXPOSE 8000 | |
| CMD ["uvicorn", "main_api:app", "--host", "0.0.0.0", "--port", "8000"] | |