Update Dockerfile
Browse files- Dockerfile +18 -14
Dockerfile
CHANGED
|
@@ -1,28 +1,32 @@
|
|
| 1 |
-
# Folosim
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Setăm folderul de lucru
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Instalăm unelte de sistem
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
#
|
| 17 |
-
|
| 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 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
#
|
|
|
|
| 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"]
|