MrA7A commited on
Commit
cd1e5a4
·
verified ·
1 Parent(s): de08086

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -2
Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
  FROM python:3.9-slim-bullseye
2
 
3
- # Set environment variables
 
 
 
4
  ENV PYTHONUNBUFFERED=1 \
5
  HF_HOME="/tmp/hf_cache" \
6
  TRANSFORMERS_CACHE="/tmp/hf_cache/transformers" \
@@ -9,18 +12,29 @@ ENV PYTHONUNBUFFERED=1 \
9
 
10
  WORKDIR /app
11
 
 
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  build-essential \
14
  cmake \
15
  libopenblas-dev \
 
 
16
  git \
 
17
  && rm -rf /var/lib/apt/lists/*
18
 
 
19
  COPY requirements.txt .
20
- RUN pip install --no-cache-dir -r requirements.txt
21
 
 
 
 
 
 
22
  COPY . .
23
 
 
24
  EXPOSE 7860
25
 
 
26
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9-slim-bullseye
2
 
3
+ # Fix locale (optional but recommended for some builds)
4
+ ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
5
+
6
+ # Python settings
7
  ENV PYTHONUNBUFFERED=1 \
8
  HF_HOME="/tmp/hf_cache" \
9
  TRANSFORMERS_CACHE="/tmp/hf_cache/transformers" \
 
12
 
13
  WORKDIR /app
14
 
15
+ # Install full build deps for llama-cpp-python
16
  RUN apt-get update && apt-get install -y --no-install-recommends \
17
  build-essential \
18
  cmake \
19
  libopenblas-dev \
20
+ libblas-dev \
21
+ liblapack-dev \
22
  git \
23
+ python3-dev \
24
  && rm -rf /var/lib/apt/lists/*
25
 
26
+ # Copy requirements
27
  COPY requirements.txt .
 
28
 
29
+ # Force pip to build from source, but with clean env
30
+ RUN pip install --upgrade pip setuptools wheel \
31
+ && pip install --no-binary=:all: --no-cache-dir -r requirements.txt
32
+
33
+ # Copy app
34
  COPY . .
35
 
36
+ # Expose port
37
  EXPOSE 7860
38
 
39
+ # Command
40
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]