Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -1,21 +1,22 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
-
|
| 7 |
rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
RUN ln -s /usr/bin/python3.10 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip
|
| 11 |
-
|
| 12 |
-
# Install Python packages
|
| 13 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 14 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 15 |
|
| 16 |
-
# Copy
|
| 17 |
COPY app.py .
|
| 18 |
|
| 19 |
-
#
|
| 20 |
EXPOSE 7860
|
|
|
|
|
|
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Sử dụng image Hugging Face có GPU, Python, Torch, Transformers sẵn
|
| 2 |
+
FROM huggingface/transformers-pytorch-gpu
|
| 3 |
|
| 4 |
+
# Cài các thư viện hệ thống cần thiết
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
+
ffmpeg libsm6 libxext6 libgl1-mesa-glx git curl && \
|
| 7 |
rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# Copy file yêu cầu Python
|
|
|
|
|
|
|
|
|
|
| 10 |
COPY requirements.txt .
|
| 11 |
+
|
| 12 |
+
# Cài thư viện Python
|
| 13 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
| 14 |
|
| 15 |
+
# Copy code chính
|
| 16 |
COPY app.py .
|
| 17 |
|
| 18 |
+
# Mở cổng FastAPI
|
| 19 |
EXPOSE 7860
|
| 20 |
+
|
| 21 |
+
# Chạy ứng dụng FastAPI
|
| 22 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|