ProfessorCEO commited on
Commit
ee7a622
·
verified ·
1 Parent(s): 21e0c2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -20
Dockerfile CHANGED
@@ -1,33 +1,37 @@
1
- # 1. Use the Pre-Built Brain (Fastest)
2
- FROM ghcr.io/abetlen/llama-cpp-python:latest
3
 
4
- # 2. Switch to Root to fix the OS
5
- USER root
 
 
 
 
6
 
7
- # 🛡️ CRITICAL FIX: Install the "Internet Address Book" (DNS & Certs)
8
- # This fixes the "[Errno -5]" error by teaching the server how to find websites.
9
- RUN apt-get update && apt-get install -y \
 
10
  ca-certificates \
11
- openssl \
12
- && update-ca-certificates
 
13
 
14
- # 3. Install Python Tools
15
- RUN pip install --no-cache-dir \
 
 
 
16
  fastapi \
17
  uvicorn \
18
  huggingface_hub \
19
  python-dotenv \
20
  pydantic \
21
- python-telegram-bot
22
-
23
- # 4. Setup User (Required by Spaces)
24
- RUN useradd -m -u 1000 user
25
- USER user
26
- ENV HOME=/home/user \
27
- PATH=/home/user/.local/bin:$PATH
28
- WORKDIR $HOME/app
29
 
30
- # 5. Copy App
31
  COPY --chown=user . .
32
 
33
  # 6. Launch
 
1
+ # 1. Use Python 3.10 (The Golden Standard - Stable & Compatible)
2
+ FROM python:3.10-slim-bullseye
3
 
4
+ # 2. Setup User (Hugging Face Requirement)
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+ ENV HOME=/home/user \
8
+ PATH=/home/user/.local/bin:$PATH
9
+ WORKDIR $HOME/app
10
 
11
+ # 3. Install Basic Tools (As Root)
12
+ USER root
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ curl \
15
  ca-certificates \
16
+ build-essential \
17
+ && rm -rf /var/lib/apt/lists/*
18
+ USER user
19
 
20
+ # 4. INSTALL AXIOM ENGINE (Binary Mode)
21
+ # Critical: We point to the "whl/cpu" URL to download the pre-built engine.
22
+ # This avoids the "Build Error" and installs in seconds.
23
+ RUN pip install --no-cache-dir --upgrade pip && \
24
+ pip install --no-cache-dir \
25
  fastapi \
26
  uvicorn \
27
  huggingface_hub \
28
  python-dotenv \
29
  pydantic \
30
+ python-telegram-bot \
31
+ llama-cpp-python \
32
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
 
 
 
 
33
 
34
+ # 5. Copy the Brain Script
35
  COPY --chown=user . .
36
 
37
  # 6. Launch