forked from giahao1411/shopping-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (71 loc) · 1.4 KB
/
docker-compose.yml
File metadata and controls
78 lines (71 loc) · 1.4 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
services:
mongodb:
image: mongo:5.0
container_name: shopping-mongodb
ports:
- "27017:27017"
volumes:
- mongo_shopping_data:/data/db
networks:
- shopping-network
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.runCommand('ping').ok" ]
interval: 10s
timeout: 5s
retries: 3
redis:
image: redis:7.0
container_name: shopping-redis
ports:
- "6379:6379"
networks:
- shopping-network
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 3
backend:
build:
context: ./back-end
env_file:
- ./back-end/.env
container_name: backend
ports:
- "8080:8080"
depends_on:
- mongodb
networks:
- shopping-network
restart: always
frontend:
build:
context: ./front-end
env_file:
- ./front-end/.env
container_name: frontend
ports:
- "5173:5173"
depends_on:
- backend
command: npm run dev -- --host
networks:
- shopping-network
restart : always
nginx:
image: nginx:latest
container_name: shopping-nginx
ports:
- "80:80"
depends_on:
- frontend
- backend
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- shopping-network
volumes:
mongo_shopping_data:
networks:
shopping-network:
driver: bridge