luck210 commited on
Commit
0216e5e
·
verified ·
1 Parent(s): aef06f1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -9
Dockerfile CHANGED
@@ -2,25 +2,26 @@
2
  FROM ubuntu:22.04
3
 
4
  # Installer les dépendances de base
5
- RUN apt update && apt install -y curl python3 python3-pip
6
 
7
  # Installer Ollama
8
  RUN curl -fsSL https://ollama.com/install.sh | sh
9
 
10
- # Installer FastAPI et Uvicorn
11
- RUN pip install fastapi uvicorn pydantic requests
12
 
13
- # Télécharger un modèle IA léger (Mistral)
14
- RUN ollama pull mistral
15
-
16
- # Copier le code de l’API dans le conteneur
17
  COPY app.py /app/app.py
18
 
19
  # Définir le dossier de travail
20
  WORKDIR /app
21
 
 
 
 
22
  # Exposer le port pour Hugging Face Spaces
23
  EXPOSE 7860
24
 
25
- # Démarrer l’API FastAPI avec le bon port
26
- CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"]
 
2
  FROM ubuntu:22.04
3
 
4
  # Installer les dépendances de base
5
+ RUN apt update && apt install -y curl python3 python3-pip
6
 
7
  # Installer Ollama
8
  RUN curl -fsSL https://ollama.com/install.sh | sh
9
 
10
+ # Installer FastAPI et dépendances
11
+ RUN pip3 install fastapi uvicorn pydantic requests
12
 
13
+ # Copier le script d’entrée et le code FastAPI
14
+ COPY entrypoint.sh /app/entrypoint.sh
 
 
15
  COPY app.py /app/app.py
16
 
17
  # Définir le dossier de travail
18
  WORKDIR /app
19
 
20
+ # Rendre le script exécutable
21
+ RUN chmod +x /app/entrypoint.sh
22
+
23
  # Exposer le port pour Hugging Face Spaces
24
  EXPOSE 7860
25
 
26
+ # Utiliser le script comme point d’entrée
27
+ ENTRYPOINT ["/app/entrypoint.sh"]