Sergidev commited on
Commit
c007ba5
1 Parent(s): cb19f03

Revert and add Cmake

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -11
Dockerfile CHANGED
@@ -18,22 +18,18 @@ RUN useradd -m -u 1000 user
18
  # Set the working directory
19
  WORKDIR /app
20
 
21
- # Create and activate virtual environment
22
- RUN python3 -m venv /app/venv
23
- ENV PATH="/app/venv/bin:$PATH"
24
-
25
  # Copy the requirements file
26
  COPY requirements.txt .
27
 
28
  # Install Python dependencies
29
- RUN . /app/venv/bin/activate && \
30
- pip install --no-cache-dir --upgrade pip && \
31
- pip install --no-cache-dir -r requirements.txt
32
 
33
  # Install llama-cpp-python with CUDA support
34
- RUN . /app/venv/bin/activate && \
35
- pip install llama-cpp-python \
36
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
 
37
 
38
  # Copy the rest of the application code
39
  COPY . .
@@ -48,4 +44,4 @@ USER user
48
  ENV PATH="/home/user/.local/bin:$PATH"
49
 
50
  # Run the application
51
- CMD ["/app/venv/bin/uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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
  # Install llama-cpp-python with CUDA support
29
+ ENV FORCE_CMAKE=1
30
+ ENV CMAKE_ARGS="-DLLAMA_CUBLAS=on"
31
+ RUN pip3 install llama-cpp-python \
32
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121
33
 
34
  # Copy the rest of the application code
35
  COPY . .
 
44
  ENV PATH="/home/user/.local/bin:$PATH"
45
 
46
  # Run the application
47
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]