CyberCoder225 commited on
Commit
ca021e5
·
verified ·
1 Parent(s): 83e7e65

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -15
Dockerfile CHANGED
@@ -1,31 +1,31 @@
1
- # 1. Use a standard Debian-based Python image
2
- FROM python:3.10-slim
3
 
4
- # 2. Install ONLY the essential glibc-compatible tools
5
- # libgomp1 is the 'Missing Link' for the llama-cpp-python library
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- libgomp1 \
 
9
  python3-dev \
10
- && rm -rf /var/lib/apt/lists/*
 
11
 
12
- # 3. Setup User environment
13
- RUN useradd -m -u 1000 user
14
  USER user
15
  ENV HOME=/home/user \
16
  PATH=/home/user/.local/bin:$PATH
17
  WORKDIR $HOME/app
18
 
19
- # 4. THE MAGIC: This command tells pip to look for 'manylinux' wheels
20
- # These are universal wheels that work on Debian/Ubuntu (Hugging Face's native language)
21
  RUN pip install --no-cache-dir \
22
  huggingface-hub \
23
  flask \
24
- --prefer-binary \
25
  llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
26
 
27
- # 5. Copy your Maira files
28
  COPY --chown=user . $HOME/app
29
 
30
- # 6. Fire up the engine
31
  CMD ["python", "app.py"]
 
1
+ # 1. Use Alpine - This natively has the 'musl' library the AI is crying for
2
+ FROM python:3.10-alpine
3
 
4
+ # 2. Install every possible dependency the brain needs to think
5
+ RUN apk add --no-cache \
6
+ build-base \
7
+ libgomp \
8
+ libstdc++ \
9
+ cmake \
10
  python3-dev \
11
+ libffi-dev \
12
+ git
13
 
14
+ # 3. Setup User
15
+ RUN adduser -D -u 1000 user
16
  USER user
17
  ENV HOME=/home/user \
18
  PATH=/home/user/.local/bin:$PATH
19
  WORKDIR $HOME/app
20
 
21
+ # 4. Install the library - Using the index that matches Alpine perfectly
 
22
  RUN pip install --no-cache-dir \
23
  huggingface-hub \
24
  flask \
 
25
  llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
26
 
27
+ # 5. Copy your files
28
  COPY --chown=user . $HOME/app
29
 
30
+ # 6. Start
31
  CMD ["python", "app.py"]