Spaces:
Paused
Paused
correction des wheels
Browse files- Dockerfile +17 -10
Dockerfile
CHANGED
@@ -14,30 +14,37 @@ RUN apt-get update && apt-get install -y \
|
|
14 |
libomp-dev \
|
15 |
&& rm -rf /var/lib/apt/lists/*
|
16 |
|
17 |
-
#
|
18 |
-
|
19 |
|
20 |
-
# 📁 Étape
|
21 |
WORKDIR /code
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
# 📥 Étape
|
24 |
COPY wheels/ ./wheels/
|
25 |
|
26 |
-
# ⚡ Étape
|
27 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
28 |
&& pip install --no-cache-dir ./wheels/llama_cpp_python-0.3.14-*.whl
|
29 |
|
30 |
-
# 📄 Étape
|
31 |
COPY requirements.txt .
|
32 |
|
33 |
-
# 📦 Étape
|
34 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
35 |
|
36 |
-
# 📁 Étape
|
37 |
COPY . .
|
38 |
|
39 |
-
#
|
|
|
|
|
|
|
40 |
EXPOSE 7860
|
41 |
|
42 |
-
# 🚀 Étape
|
43 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
14 |
libomp-dev \
|
15 |
&& rm -rf /var/lib/apt/lists/*
|
16 |
|
17 |
+
# 👤 Étape 3 : Créer un utilisateur non-root "appuser"
|
18 |
+
RUN useradd -ms /bin/bash appuser
|
19 |
|
20 |
+
# 📁 Étape 4 : Créer le dossier de travail avec droits pour appuser
|
21 |
WORKDIR /code
|
22 |
+
RUN mkdir -p /code/.streamlit && chown -R appuser:appuser /code
|
23 |
+
|
24 |
+
# ⚠️ Étape 5 : définir le HOME pour Streamlit
|
25 |
+
ENV HOME="/code"
|
26 |
|
27 |
+
# 📥 Étape 6 : copier les wheels (llama-cpp-python précompilée)
|
28 |
COPY wheels/ ./wheels/
|
29 |
|
30 |
+
# ⚡ Étape 7 : installer pip et la wheel locale
|
31 |
RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
32 |
&& pip install --no-cache-dir ./wheels/llama_cpp_python-0.3.14-*.whl
|
33 |
|
34 |
+
# 📄 Étape 8 : copier requirements.txt (sans llama-cpp-python dedans)
|
35 |
COPY requirements.txt .
|
36 |
|
37 |
+
# 📦 Étape 9 : installer le reste des dépendances
|
38 |
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
|
39 |
|
40 |
+
# 📁 Étape 10 : copier tout le code de l'application
|
41 |
COPY . .
|
42 |
|
43 |
+
# 👤 Étape 11 : basculer en utilisateur non-root pour exécution
|
44 |
+
USER appuser
|
45 |
+
|
46 |
+
# 🌐 Étape 12 : exposer le port Streamlit
|
47 |
EXPOSE 7860
|
48 |
|
49 |
+
# 🚀 Étape 13 : lancer Streamlit
|
50 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|