Axcel1 commited on
Commit
9d309ad
·
verified ·
1 Parent(s): 757427c

Create Docker

Browse files
Files changed (1) hide show
  1. Docker +48 -0
Docker ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
6
+
7
+ # Install Python and system dependencies
8
+ 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="-DLLAMA_CUBLAS=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
35
+ COPY . .
36
+
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"]