Sergidev commited on
Commit
9689eed
1 Parent(s): 57fda94

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -18
Dockerfile CHANGED
@@ -1,10 +1,7 @@
1
- # Use the NVIDIA CUDA image as the base
2
  FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu20.04
3
 
4
- # Set non-interactive mode for apt-get
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
- # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  python3 \
10
  python3-pip \
@@ -12,37 +9,23 @@ RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Set up a new user named "user" with user ID 1000
16
  RUN useradd -m -u 1000 user
17
 
18
- # Set the working directory
19
  WORKDIR /app
20
 
21
- # Copy the requirements file
22
  COPY requirements.txt .
23
 
24
- # Install Python dependencies
25
  RUN pip3 install --no-cache-dir --upgrade pip && \
26
  pip3 install --no-cache-dir -r requirements.txt
27
-
28
 
29
- # Install llama-cpp-python with CUDA support
30
- #ENV FORCE_CMAKE=1
31
- #ENV CMAKE_ARGS="-DGGML_CUDA=on"
32
- RUN pip3 install llama-cpp-python \
33
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
34
 
35
- # Copy the rest of the application code
36
  COPY . .
37
 
38
- # Change ownership of the app directory to the user
39
  RUN chown -R user:user /app
40
 
41
- # Switch to the "user" user
42
  USER user
43
 
44
- # Set the PATH to include the user's local bin directory
45
  ENV PATH="/home/user/.local/bin:$PATH"
46
 
47
- # Run the application
48
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu20.04
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  python3 \
7
  python3-pip \
 
9
  build-essential \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  RUN useradd -m -u 1000 user
13
 
 
14
  WORKDIR /app
15
 
 
16
  COPY requirements.txt .
17
 
 
18
  RUN pip3 install --no-cache-dir --upgrade pip && \
19
  pip3 install --no-cache-dir -r requirements.txt
 
20
 
21
+ RUN pip3 install ctransformers[cuda]
 
 
 
 
22
 
 
23
  COPY . .
24
 
 
25
  RUN chown -R user:user /app
26
 
 
27
  USER user
28
 
 
29
  ENV PATH="/home/user/.local/bin:$PATH"
30
 
 
31
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]