ginhang2209 commited on
Commit
886c699
·
verified ·
1 Parent(s): 25d3ea8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,21 +1,22 @@
1
- # Base image có CUDA
2
- FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
3
 
4
- # Install basic packages
5
  RUN apt-get update && apt-get install -y \
6
- python3.10 python3-pip git curl ffmpeg libsm6 libxext6 libgl1-mesa-glx && \
7
  rm -rf /var/lib/apt/lists/*
8
 
9
- # Set python and pip aliases
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 app code
17
  COPY app.py .
18
 
19
- # Expose port and run API
20
  EXPOSE 7860
 
 
21
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Sử dụng image Hugging Face 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"]