forked from hereisSwapnil/ExamTime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
92 lines (81 loc) · 1.71 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
# version: '3'
# services:
# backend:
# container_name: server
# build:
# context: ./server
# dockerfile: Dockerfile
# ports:
# - "8080:8080" # Map container port 3000 to host port 3001
# networks:
# - app-network
# frontend:
# container_name: client
# build:
# context: ./client
# dockerfile: Dockerfile
# ports:
# - "3000:3000" # Map container port 3000 to host port 3000
# networks:
# - app-network
# mongodb:
# container_name: mongodb
# image: mongo
# ports:
# - "27017:27017" # Map container port 27017 to host port 27017
# networks:
# - app-network
# networks:
# app-network:
# driver: bridge
version: '3'
services:
frontend:
build:
context: './client'
dockerfile: Dockerfile
ports:
- 3000:3000
container_name: react-container
command: npm start
networks:
- mern-stack-network
volumes:
- ./client:/app
- /app/node_modules
depends_on:
- backend
backend:
build:
context: './server'
dockerfile: Dockerfile
ports:
- 8080:8080
container_name: express-container
command: /app/node_modules/.bin/nodemon server.jsntainer
networks:
- mern-stack-network
volumes:
- ./server:/app
- /app/node_modules
depends_on:
- mongo
env_file: ./server/.env
environment:
- NODE_ENV=development
mongo:
image: mongo
ports:
- 27017:27017
container_name: mongo-container
networks:
- mern-stack-network
volumes:
- mongoData:/data/db
networks:
mern-stack-network:
volumes:
mongoData:
node_modules:
web_root:
driver: bridge