CyberCoder225 commited on
Commit
ca888f9
·
verified ·
1 Parent(s): b092f4a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -1,27 +1,29 @@
1
- # Use Alpine: The "Lightweight King" that natively speaks 'musl'
2
  FROM python:3.10-alpine
3
 
4
- # Install system tools needed for the brain
5
  RUN apk add --no-cache \
6
- build-base \
7
  libgomp \
8
  libstdc++ \
9
- cmake \
10
- python3-dev \
11
- libffi-dev
12
 
 
13
  RUN adduser -D -u 1000 user
14
  USER user
15
  ENV HOME=/home/user \
16
  PATH=/home/user/.local/bin:$PATH
17
  WORKDIR $HOME/app
18
 
19
- # Install packages - This will now find the perfect 'musl' wheel
 
20
  RUN pip install --no-cache-dir \
21
  huggingface-hub \
22
  flask \
 
23
  llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
24
 
 
25
  COPY --chown=user . $HOME/app
26
 
 
27
  CMD ["python", "app.py"]
 
1
+ # 1. Use Alpine - This is the "Musl" environment the wheels want
2
  FROM python:3.10-alpine
3
 
4
+ # 2. Install only the runtime math libraries (No heavy compilers needed)
5
  RUN apk add --no-cache \
 
6
  libgomp \
7
  libstdc++ \
8
+ libgcc
 
 
9
 
10
+ # 3. Setup the user for Hugging Face
11
  RUN adduser -D -u 1000 user
12
  USER user
13
  ENV HOME=/home/user \
14
  PATH=/home/user/.local/bin:$PATH
15
  WORKDIR $HOME/app
16
 
17
+ # 4. Force-install the pre-built Alpine wheel
18
+ # This index hosts the 'musl' wheels that match this OS perfectly
19
  RUN pip install --no-cache-dir \
20
  huggingface-hub \
21
  flask \
22
+ --prefer-binary \
23
  llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
24
 
25
+ # 5. Bring in your Maira code
26
  COPY --chown=user . $HOME/app
27
 
28
+ # 6. Run the engine
29
  CMD ["python", "app.py"]