viskav commited on
Commit
a095a2a
·
verified ·
1 Parent(s): 72ff81a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -8
Dockerfile CHANGED
@@ -2,24 +2,26 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /code
4
 
5
- # Install ONLY essential build dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
 
 
8
  cmake \
9
- libopenblas-dev \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Copy requirements first
13
  COPY requirements.txt .
14
 
15
- # Install with OpenBLAS optimization (CRITICAL FOR SPEED)
16
- ENV CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS"
17
- RUN pip install --no-cache-dir -r requirements.txt
18
 
19
  # Copy app
20
  COPY app.py .
21
 
22
- # Environment optimizations
23
  ENV PYTHONUNBUFFERED=1
24
  ENV N_THREADS=8
25
  ENV N_CTX=512
@@ -27,5 +29,4 @@ ENV N_BATCH=256
27
 
28
  EXPOSE 7860
29
 
30
- # Use uvicorn directly with optimized workers
31
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
2
 
3
  WORKDIR /code
4
 
5
+ # Install build dependencies
6
  RUN apt-get update && apt-get install -y \
7
  build-essential \
8
+ gcc \
9
+ g++ \
10
  cmake \
11
+ git \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # Copy requirements first
15
  COPY requirements.txt .
16
 
17
+ # Install Python packages
18
+ RUN pip install --upgrade pip && \
19
+ pip install --no-cache-dir -r requirements.txt
20
 
21
  # Copy app
22
  COPY app.py .
23
 
24
+ # Environment variables for optimization
25
  ENV PYTHONUNBUFFERED=1
26
  ENV N_THREADS=8
27
  ENV N_CTX=512
 
29
 
30
  EXPOSE 7860
31
 
32
+ CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]