-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (74 loc) · 1.78 KB
/
Copy pathdocker-compose.yml
File metadata and controls
79 lines (74 loc) · 1.78 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
version: '3.8'
services:
# Base de données MySQL
database:
image: mysql:8.0
container_name: gestion-absences-db
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-rootpassword}
MYSQL_DATABASE: ${DB_NAME:-gestion_absences}
MYSQL_USER: ${DB_USER:-app_user}
MYSQL_PASSWORD: ${DB_PASSWORD:-rootpassword}
volumes:
- mysql_data:/var/lib/mysql
- ./backend/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "3307:3306"
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
# Backend Node.js + Express
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: gestion-absences-backend
restart: always
environment:
NODE_ENV: production
PORT: 5000
DB_HOST: database
DB_USER: ${DB_USER:-app_user}
DB_PASSWORD: ${DB_PASSWORD:-rootpassword}
DB_NAME: ${DB_NAME:-gestion_absences}
DB_PORT: 3306
JWT_SECRET: ${JWT_SECRET:-your_super_secret_jwt_key_change_me_in_production}
JWT_EXPIRE: 7d
CORS_ORIGIN: http://localhost:80
ports:
- "5000:5000"
depends_on:
database:
condition: service_healthy
networks:
- app-network
volumes:
- ./backend:/app
- /app/node_modules
# Frontend React
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: /api
container_name: gestion-absences-frontend
restart: always
ports:
- "80:80"
depends_on:
- backend
networks:
- app-network
environment:
VITE_API_URL: /api
networks:
app-network:
driver: bridge
volumes:
mysql_data:
driver: local