File size: 1,061 Bytes
ee7a622
 
ac4ef7f
ee7a622
 
 
 
 
 
fb559c4
ee7a622
 
 
 
21e0c2e
ee7a622
 
 
21e0c2e
ee7a622
 
 
 
 
46b2625
 
 
 
 
ee7a622
 
 
ac4ef7f
ee7a622
ac4ef7f
fb559c4
21e0c2e
ac4ef7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 1. Use Python 3.10 (The Golden Standard - Stable & Compatible)
FROM python:3.10-slim-bullseye

# 2. Setup User (Hugging Face Requirement)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app

# 3. Install Basic Tools (As Root)
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    build-essential \
    && rm -rf /var/lib/apt/lists/*
USER user

# 4. INSTALL AXIOM ENGINE (Binary Mode)
# Critical: We point to the "whl/cpu" URL to download the pre-built engine.
# This avoids the "Build Error" and installs in seconds.
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir \
    fastapi \
    uvicorn \
    huggingface_hub \
    python-dotenv \
    pydantic \
    python-telegram-bot \
    llama-cpp-python \
    --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu

# 5. Copy the Brain Script
COPY --chown=user . .

# 6. Launch
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]