Ali2206 commited on
Commit
60dd7db
·
verified ·
1 Parent(s): 063d90d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -16
Dockerfile CHANGED
@@ -1,5 +1,4 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
 
4
  # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE 1
@@ -7,31 +6,32 @@ ENV PYTHONUNBUFFERED 1
7
  ENV HF_HOME=/data/hf_cache
8
  ENV TRANSFORMERS_CACHE=/data/hf_cache/txagent_models
9
 
10
- # Create and set working directory
11
- WORKDIR /app
12
-
13
  # Install system dependencies
14
  RUN apt-get update && apt-get install -y \
 
 
 
15
  build-essential \
16
  libpoppler-cpp-dev \
17
- pkg-config \
18
- python3-dev \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
- # Install Python dependencies
 
 
 
 
 
 
 
 
 
22
  COPY requirements.txt .
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # Create necessary directories
26
- RUN mkdir -p /data/hf_cache/txagent_models \
27
- /data/hf_cache/tool_cache \
28
- /data/hf_cache/cache \
29
- /data/hf_cache/reports
30
-
31
- # Copy the application code
32
  COPY . .
33
 
34
- # Expose the port the app runs on
35
  EXPOSE 7860
36
 
37
  # Command to run the application
 
1
+ FROM nvidia/cuda:12.1.1-base-ubuntu22.04
 
2
 
3
  # Set environment variables
4
  ENV PYTHONDONTWRITEBYTECODE 1
 
6
  ENV HF_HOME=/data/hf_cache
7
  ENV TRANSFORMERS_CACHE=/data/hf_cache/txagent_models
8
 
 
 
 
9
  # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
11
+ python3.9 \
12
+ python3-pip \
13
+ python3.9-dev \
14
  build-essential \
15
  libpoppler-cpp-dev \
 
 
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Create and set working directory
19
+ WORKDIR /app
20
+
21
+ # Install specific versions of PyTorch and vLLM
22
+ RUN pip install --no-cache-dir \
23
+ torch==2.1.2+cu121 \
24
+ --extra-index-url https://download.pytorch.org/whl/cu121
25
+ RUN pip install --no-cache-dir vllm==0.3.0
26
+
27
+ # Copy requirements first to leverage Docker cache
28
  COPY requirements.txt .
29
  RUN pip install --no-cache-dir -r requirements.txt
30
 
31
+ # Copy application code
 
 
 
 
 
 
32
  COPY . .
33
 
34
+ # Expose port
35
  EXPOSE 7860
36
 
37
  # Command to run the application