-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
99 lines (91 loc) · 1.77 KB
/
docker-compose.yml
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
version: '3.8'
services:
client:
build:
context: ./client
dockerfile: Dockerfile
ports:
- '3000:3000'
env_file:
- ./client/.env
volumes:
- ./client:/app
- /app/node_modules
depends_on:
- server
server:
build:
context: ./server
dockerfile: Dockerfile
ports:
- '5000:5000'
env_file:
- ./server/.env.development # Par défaut, environnement de développement
volumes:
- ./server:/app
- /app/node_modules
depends_on:
- mongo
environment:
- NODE_ENV=development
mongo:
image: mongo
ports:
- '27017:27017'
volumes:
- mongo-data:/data/db
# Pas d'authentification pour développement et test par défaut
server_production:
build:
context: ./server
dockerfile: Dockerfile
ports:
- '5000:5000'
env_file:
- ./server/.env.production
volumes:
- ./server:/app
- /app/node_modules
depends_on:
- mongo
environment:
- NODE_ENV=production
profiles:
- prod
mongo_production:
image: mongo
ports:
- '27017:27017'
volumes:
- mongo-data:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=secureUsername
- MONGO_INITDB_ROOT_PASSWORD=securePassword
profiles:
- prod
server_test:
build:
context: ./server
dockerfile: Dockerfile
command: npm test
env_file:
- ./server/.env.test
volumes:
- ./server:/app
- /app/node_modules
depends_on:
- mongo
environment:
- NODE_ENV=test
profiles:
- test
mongo_test:
image: mongo
ports:
- '27017:27017'
volumes:
- mongo-data:/data/db
profiles:
- test
volumes:
mongo-data: