Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|