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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -6
Dockerfile CHANGED
@@ -1,10 +1,17 @@
1
- # ☢️ NUCLEAR OPTION: Use the Official Pre-Built Image
2
  FROM ghcr.io/abetlen/llama-cpp-python:latest
3
 
4
- # 1. Switch to Root to install our extra tools
5
  USER root
6
 
7
- # 2. Install Dependencies (Added python-telegram-bot)
 
 
 
 
 
 
 
8
  RUN pip install --no-cache-dir \
9
  fastapi \
10
  uvicorn \
@@ -13,15 +20,15 @@ RUN pip install --no-cache-dir \
13
  pydantic \
14
  python-telegram-bot
15
 
16
- # 3. Setup the User (Strict Requirement for Hugging Face Spaces)
17
  RUN useradd -m -u 1000 user
18
  USER user
19
  ENV HOME=/home/user \
20
  PATH=/home/user/.local/bin:$PATH
21
  WORKDIR $HOME/app
22
 
23
- # 4. Copy our "Librarian" Script
24
  COPY --chown=user . .
25
 
26
- # 5. Launch the Server
27
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
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 \
 
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
34
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]