pathii commited on
Commit
52d2f6a
·
verified ·
1 Parent(s): a69cba0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -7
Dockerfile CHANGED
@@ -1,12 +1,11 @@
1
  FROM python:3.8-slim
2
 
3
- # Set environment variables
4
  ENV PYTHONUNBUFFERED=1 \
5
  DEBIAN_FRONTEND=noninteractive \
6
- PIP_NO_CACHE_DIR=1 \
7
- PIP_DISABLE_PIP_VERSION_CHECK=1
8
 
9
- # Install system dependencies first
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  build-essential \
12
  libopenblas-dev \
@@ -15,16 +14,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
15
  cmake \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Install Python dependencies in two stages
19
  COPY requirements.txt .
20
  RUN pip install --upgrade pip setuptools wheel && \
21
- pip install torch --index-url https://download.pytorch.org/whl/cpu && \
 
22
  pip install -r requirements.txt
23
 
24
  WORKDIR /app
25
  COPY . /app
26
 
27
- # Pre-create directories
28
  RUN mkdir -p /app/checkpoints /app/logs
29
 
30
  CMD ["python", "train.py"]
 
1
  FROM python:3.8-slim
2
 
3
+ # 1. Set environment variables
4
  ENV PYTHONUNBUFFERED=1 \
5
  DEBIAN_FRONTEND=noninteractive \
6
+ PIP_NO_CACHE_DIR=1
 
7
 
8
+ # 2. Install system dependencies
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  build-essential \
11
  libopenblas-dev \
 
14
  cmake \
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # 3. Install Python packages in optimal order
18
  COPY requirements.txt .
19
  RUN pip install --upgrade pip setuptools wheel && \
20
+ pip install torch==2.2.1 --index-url https://download.pytorch.org/whl/cpu && \
21
+ pip install --no-deps vllm==0.3.0 && \
22
  pip install -r requirements.txt
23
 
24
  WORKDIR /app
25
  COPY . /app
26
 
27
+ # 4. Create necessary directories
28
  RUN mkdir -p /app/checkpoints /app/logs
29
 
30
  CMD ["python", "train.py"]