nia2 commited on
Commit
7448e1e
·
verified ·
1 Parent(s): b335c2a

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +46 -0
Dockerfile ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ # Installer les dépendances système
4
+ RUN apt-get update && apt-get install -y \
5
+ git \
6
+ git-lfs \
7
+ ffmpeg \
8
+ libsm6 \
9
+ libxext6 \
10
+ cmake \
11
+ rsync \
12
+ libgl1-mesa-glx \
13
+ && rm -rf /var/lib/apt/lists/* \
14
+ && git lfs install
15
+
16
+ # Installer les dépendances Python
17
+ COPY requirements.txt /tmp/requirements.txt
18
+ RUN pip install --no-cache-dir pip==22.3.1 && \
19
+ pip install --no-cache-dir \
20
+ datasets \
21
+ "huggingface-hub>=0.19" \
22
+ "hf-transfer>=0.1.4" \
23
+ "protobuf<4" \
24
+ "click<8.1" \
25
+ "pydantic~=1.0"
26
+
27
+ # Installer les dépendances spécifiques de l'application
28
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
29
+
30
+ # Définir le répertoire de travail
31
+ WORKDIR /home/user/app
32
+
33
+ # Copier le code de l'application
34
+ COPY . /home/user/app
35
+
36
+ # Définir l'utilisateur par défaut
37
+ RUN useradd -m -u 1000 user
38
+
39
+ # Définir l'utilisateur par défaut pour exécuter les commandes
40
+ USER user
41
+
42
+ # Exposer le port pour l'application
43
+ EXPOSE 7860
44
+
45
+ # Commande pour lancer l'application
46
+ CMD ["python", "app.py"]