Spaces:
Sleeping
Sleeping
pakito312
commited on
Commit
·
afb5ae8
1
Parent(s):
b8dc6dd
update
Browse files- Dockerfile +11 -11
- requirements.txt +2 -1
Dockerfile
CHANGED
|
@@ -1,11 +1,6 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
ENV DEBIAN_FRONTEND=noninteractive \
|
| 5 |
-
OLLAMA_HOST=0.0.0.0 \
|
| 6 |
-
PYTHONUNBUFFERED=1
|
| 7 |
-
|
| 8 |
-
# Installer les dépendances
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
curl \
|
| 11 |
ca-certificates \
|
|
@@ -16,7 +11,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
# Installer Ollama
|
| 17 |
RUN curl -fsSL https://ollama.ai/install.sh | sh
|
| 18 |
|
| 19 |
-
# Créer utilisateur
|
| 20 |
RUN useradd -m -u 1000 user
|
| 21 |
USER user
|
| 22 |
WORKDIR /home/user
|
|
@@ -25,10 +20,15 @@ WORKDIR /home/user
|
|
| 25 |
COPY --chown=user:user api.py .
|
| 26 |
COPY --chown=user:user requirements.txt .
|
| 27 |
|
| 28 |
-
# Installer Python
|
| 29 |
-
RUN pip install --no-cache-dir --user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
CMD ["sh", "-c", "ollama serve & sleep
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Installer les dépendances système
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
curl \
|
| 6 |
ca-certificates \
|
|
|
|
| 11 |
# Installer Ollama
|
| 12 |
RUN curl -fsSL https://ollama.ai/install.sh | sh
|
| 13 |
|
| 14 |
+
# Créer un utilisateur non-root
|
| 15 |
RUN useradd -m -u 1000 user
|
| 16 |
USER user
|
| 17 |
WORKDIR /home/user
|
|
|
|
| 20 |
COPY --chown=user:user api.py .
|
| 21 |
COPY --chown=user:user requirements.txt .
|
| 22 |
|
| 23 |
+
# Installer TOUTES les dépendances Python
|
| 24 |
+
RUN pip install --no-cache-dir --user \
|
| 25 |
+
fastapi==0.104.1 \
|
| 26 |
+
uvicorn[standard]==0.24.0 \
|
| 27 |
+
pydantic==2.5.0 \
|
| 28 |
+
aiohttp==3.9.1 \
|
| 29 |
+
requests==2.31.0
|
| 30 |
|
| 31 |
EXPOSE 7860
|
| 32 |
|
| 33 |
+
# Démarrer
|
| 34 |
+
CMD ["sh", "-c", "ollama serve & sleep 30 && ollama pull deepseek-coder:1.3b && uvicorn api:app --host 0.0.0.0 --port 7860"]
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
fastapi==0.104.1
|
| 2 |
uvicorn[standard]==0.24.0
|
| 3 |
pydantic==2.5.0
|
| 4 |
-
aiohttp==3.
|
|
|
|
|
|
| 1 |
fastapi==0.104.1
|
| 2 |
uvicorn[standard]==0.24.0
|
| 3 |
pydantic==2.5.0
|
| 4 |
+
aiohttp==3.13.3
|
| 5 |
+
requests==2.31.0
|