i04n4 commited on
Commit
0d9932e
·
verified ·
1 Parent(s): 96f4b5f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -14
Dockerfile CHANGED
@@ -1,28 +1,32 @@
1
- # Folosim o imagine oficială Python bazată pe Debian (fixează problema cu musl/glibc)
2
  FROM python:3.10-slim
3
 
4
  # Setăm folderul de lucru
5
  WORKDIR /app
6
 
7
- # Instalăm unelte de sistem de bază (pentru siguranță)
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
 
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Copiem aplicația în container
13
- COPY . .
14
 
15
- # INSTALAREA MAGICĂ
16
- # 1. Facem upgrade la pip
17
- # 2. Instalăm gradio și huggingface_hub
18
- # 3. Instalăm llama-cpp-python folosind INDEX-ul oficial pentru CPU (evită compilarea)
19
- RUN pip install --no-cache-dir --upgrade pip && \
20
- pip install --no-cache-dir huggingface_hub gradio && \
21
- pip install --no-cache-dir llama-cpp-python \
22
  --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
23
 
24
- # Deschidem portul pentru Gradio
25
- EXPOSE 7860
 
 
 
 
 
 
26
 
27
- # Comanda de start
 
28
  CMD ["python", "app.py"]
 
1
+ # Folosim Python 3.10 Slim
2
  FROM python:3.10-slim
3
 
4
  # Setăm folderul de lucru
5
  WORKDIR /app
6
 
7
+ # 1. Instalăm unelte de sistem (necesare pentru download și setup)
8
  RUN apt-get update && apt-get install -y \
9
  build-essential \
10
+ curl \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # 2. Upgrade la PIP
14
+ RUN pip install --no-cache-dir --upgrade pip
15
 
16
+ # 3. INSTALĂM LLAMA-CPP-PYTHON SEPARAT (Pasul Critic)
17
+ # Folosim link-ul direct către arhiva WHL pentru CPU, ca să nu compileze nimic
18
+ RUN pip install --no-cache-dir llama-cpp-python \
 
 
 
 
19
  --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
20
 
21
+ # 4. Instalăm restul bibliotecilor
22
+ RUN pip install --no-cache-dir huggingface_hub gradio
23
+
24
+ # 5. COPIEM APLICAȚIA (Abia acum aducem app.py)
25
+ COPY . .
26
+
27
+ # Verificăm că s-a instalat (pentru debugging în loguri)
28
+ RUN pip list | grep llama
29
 
30
+ # Portul și Comanda
31
+ EXPOSE 7860
32
  CMD ["python", "app.py"]