Axcel1 commited on
Commit
0f7413f
·
verified ·
1 Parent(s): 7dada66

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -13
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
- # Use NVIDIA CUDA base image with Ubuntu and Python support
2
- FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
3
 
4
  # Set working directory
5
  WORKDIR /app
@@ -9,26 +9,22 @@ RUN apt-get update && apt-get install -y \
9
  python3.10 \
10
  python3-pip \
11
  python3.10-venv \
12
- build-essential \
13
- cmake \
14
  git \
15
  curl \
16
  wget \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # Use python3.10 as default
20
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
21
 
22
  # Upgrade pip
23
  RUN pip install --upgrade pip
24
 
25
- # Set CUDA build flag for llama-cpp-python
26
- ENV CMAKE_ARGS="-DGGML_CUDA=on"
27
 
28
- # Copy requirements first for layer caching
29
  COPY requirements.txt .
30
-
31
- # Install dependencies (llama-cpp-python will compile with CUDA here)
32
  RUN pip install --no-cache-dir -r requirements.txt
33
 
34
  # Copy app code
@@ -37,12 +33,12 @@ COPY . .
37
  # Create models directory
38
  RUN mkdir -p models
39
 
40
- # Expose Gradio port
41
  EXPOSE 7860
42
 
43
- # Environment for Gradio
44
  ENV GRADIO_SERVER_NAME="0.0.0.0"
45
  ENV GRADIO_SERVER_PORT=7860
46
 
47
- # Run the app
48
  CMD ["python", "app.py"]
 
1
+ # Use NVIDIA CUDA base image with Python support
2
+ FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
3
 
4
  # Set working directory
5
  WORKDIR /app
 
9
  python3.10 \
10
  python3-pip \
11
  python3.10-venv \
 
 
12
  git \
13
  curl \
14
  wget \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Make python3.10 the default
18
  RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
19
 
20
  # Upgrade pip
21
  RUN pip install --upgrade pip
22
 
23
+ # Install prebuilt llama-cpp-python CUDA wheel (cu121)
24
+ RUN pip install --no-cache-dir llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
25
 
26
+ # Copy requirements.txt and install remaining dependencies
27
  COPY requirements.txt .
 
 
28
  RUN pip install --no-cache-dir -r requirements.txt
29
 
30
  # Copy app code
 
33
  # Create models directory
34
  RUN mkdir -p models
35
 
36
+ # Expose Gradio or web port
37
  EXPOSE 7860
38
 
39
+ # Gradio settings
40
  ENV GRADIO_SERVER_NAME="0.0.0.0"
41
  ENV GRADIO_SERVER_PORT=7860
42
 
43
+ # Start app
44
  CMD ["python", "app.py"]