-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (97 loc) · 2.18 KB
/
docker-compose.yml
File metadata and controls
103 lines (97 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: "3.8"
services:
# Base de données MySQL
mysql:
image: mysql:8.0
container_name: taf-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: tafdb
MYSQL_USER: tafuser
MYSQL_PASSWORD: tafpassword
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test:
[
"CMD",
"mysqladmin",
"ping",
"-h",
"localhost",
"-u",
"root",
"-prootpassword",
]
interval: 10s
timeout: 5s
retries: 5
networks:
- taf-network
# Base de données MongoDB
mongodb:
image: mongo:7
container_name: taf-mongodb
restart: unless-stopped
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
environment:
MONGO_INITDB_DATABASE: tafdb
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
networks:
- taf-network
# Backend Spring Boot
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: taf-backend
restart: unless-stopped
ports:
- "8085:8085"
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/tafdb?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC
SPRING_DATASOURCE_USERNAME: tafuser
SPRING_DATASOURCE_PASSWORD: tafpassword
SPRING_DATA_MONGODB_URI: mongodb://mongodb:27017/tafdb
SERVER_PORT: 8085
depends_on:
mysql:
condition: service_healthy
mongodb:
condition: service_healthy
networks:
- taf-network
volumes:
- ./backend/src/main/resources:/app/resources
# Frontend Vue.js
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: taf-frontend
restart: unless-stopped
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:8085
- NODE_ENV=production
depends_on:
- backend
networks:
- taf-network
networks:
taf-network:
driver: bridge
volumes:
mysql_data:
mongodb_data: