Clément PEPONNET commited on
Commit
c2bd444
·
1 Parent(s): 0b084f3

chore: add docker implem

Browse files
Files changed (4) hide show
  1. .dockerignore +39 -0
  2. Dockerfile +25 -0
  3. README.md +41 -0
  4. docker-compose.yml +12 -0
.dockerignore ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Git
2
+ .git
3
+ .gitattributes
4
+ .gitignore
5
+
6
+ # Python
7
+ __pycache__
8
+ *.pyc
9
+ *.pyo
10
+ *.pyd
11
+ .Python
12
+ *.so
13
+ *.egg
14
+ *.egg-info
15
+ dist
16
+ build
17
+ .venv
18
+ venv
19
+ env
20
+
21
+ # IDE
22
+ .vscode
23
+ .idea
24
+ *.swp
25
+ *.swo
26
+ *~
27
+
28
+ # OS
29
+ .DS_Store
30
+ Thumbs.db
31
+
32
+ # Docker
33
+ Dockerfile
34
+ .dockerignore
35
+ docker-compose.yml
36
+
37
+ # Documentation (keep README.md in image if needed)
38
+ *.md
39
+ !README.md
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.11 slim image for smaller size
2
+ FROM python:3.11-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Copy requirements first for better caching
8
+ COPY requirements.txt .
9
+
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Copy application files
14
+ COPY app.py .
15
+ COPY index.html .
16
+
17
+ # Expose the default Gradio port
18
+ EXPOSE 7860
19
+
20
+ # Set environment variables
21
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
22
+ ENV GRADIO_SERVER_PORT="7860"
23
+
24
+ # Run the application
25
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -35,6 +35,47 @@ Le collectif est composé par :
35
  - Charles
36
  - Martin
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  ---
39
 
40
  *Ci vole à campà per cantà, è cantà per campà*
 
35
  - Charles
36
  - Martin
37
 
38
+ ## Déploiement Docker
39
+
40
+ ### Prérequis
41
+
42
+ - Docker
43
+ - Docker Compose (optionnel mais recommandé)
44
+
45
+ ### Option 1 : Avec Docker Compose (recommandé)
46
+
47
+ ```bash
48
+ # Lancer l'application
49
+ docker-compose up -d
50
+
51
+ # Voir les logs
52
+ docker-compose logs -f
53
+
54
+ # Arrêter l'application
55
+ docker-compose down
56
+ ```
57
+
58
+ ### Option 2 : Avec Docker seulement
59
+
60
+ ```bash
61
+ # Construire l'image
62
+ docker build -t collectif-corse .
63
+
64
+ # Lancer le conteneur
65
+ docker run -d -p 7860:7860 --name collectif-corse-app collectif-corse
66
+
67
+ # Voir les logs
68
+ docker logs -f collectif-corse-app
69
+
70
+ # Arrêter le conteneur
71
+ docker stop collectif-corse-app
72
+ docker rm collectif-corse-app
73
+ ```
74
+
75
+ ### Accès à l'application
76
+
77
+ Une fois déployée, l'application est accessible sur : `http://localhost:7860`
78
+
79
  ---
80
 
81
  *Ci vole à campà per cantà, è cantà per campà*
docker-compose.yml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+
3
+ services:
4
+ collectif-corse:
5
+ build: .
6
+ ports:
7
+ - "7860:7860"
8
+ environment:
9
+ - GRADIO_SERVER_NAME=0.0.0.0
10
+ - GRADIO_SERVER_PORT=7860
11
+ restart: unless-stopped
12
+ container_name: collectif-corse-app