Sabithulla commited on
Commit
639666f
·
1 Parent(s): 9f226af

Optimize: use --prefer-binary for wheels on Linux but not committed

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -5
  2. requirements.txt +1 -0
Dockerfile CHANGED
@@ -1,18 +1,18 @@
1
- FROM ghcr.io/abetlen/llama-cpp-python:latest
2
 
3
  WORKDIR /app
4
 
5
- # Install additional system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  tesseract-ocr \
8
  libtesseract-dev \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Copy requirements (llama-cpp-python NOT included - already in base image!)
12
  COPY requirements.txt .
13
 
14
- # Install remaining dependencies
15
- RUN pip install --no-cache-dir -r requirements.txt
16
 
17
  # Copy app
18
  COPY . .
 
1
+ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies (minimal, no build tools for base)
6
  RUN apt-get update && apt-get install -y \
7
  tesseract-ocr \
8
  libtesseract-dev \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements
12
  COPY requirements.txt .
13
 
14
+ # Install with binary preference (uses wheels if available, falls back to source)
15
+ RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
16
 
17
  # Copy app
18
  COPY . .
requirements.txt CHANGED
@@ -1,5 +1,6 @@
1
  fastapi
2
  uvicorn
 
3
  supabase
4
  python-multipart
5
  pytesseract
 
1
  fastapi
2
  uvicorn
3
+ llama-cpp-python
4
  supabase
5
  python-multipart
6
  pytesseract