-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
134 lines (122 loc) · 2.63 KB
/
docker-compose.yaml
File metadata and controls
134 lines (122 loc) · 2.63 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
version: '3.8'
services:
frontend:
build:
context: ./applications/frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=http://localhost:8080
networks:
- ecommerce-net
api-gateway:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./infrastructure/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- product-service
- user-service
- order-service
- cart-service
networks:
- ecommerce-net
product-service:
build:
context: ./applications/product-service
dockerfile: Dockerfile
ports:
- "3001:3001"
environment:
- DATABASE_URL=postgres://user:password@postgres:5432/products
- PORT=3001
depends_on:
- postgres
networks:
- ecommerce-net
user-service:
build:
context: ./applications/user-service
dockerfile: Dockerfile
ports:
- "3002:3002"
environment:
- DATABASE_URL=postgres://user:password@postgres:5432/users
- PORT=3002
depends_on:
- postgres
networks:
- ecommerce-net
order-service:
build:
context: ./applications/order-service
dockerfile: Dockerfile
ports:
- "3003:3003"
environment:
- DATABASE_URL=postgres://user:password@postgres:5432/orders
- PORT=3003
depends_on:
- postgres
networks:
- ecommerce-net
cart-service:
build:
context: ./applications/cart-service
dockerfile: Dockerfile
ports:
- "3004:3004"
environment:
- REDIS_URL=redis://redis:6379
- PORT=3004
depends_on:
- redis
networks:
- ecommerce-net
postgres:
image: postgres:15
environment:
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_MULTIPLE_DATABASES=products,users,orders
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- ecommerce-net
redis:
image: redis:7
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- ecommerce-net
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- ecommerce-net
grafana:
image: grafana/grafana:latest
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-data:/var/lib/grafana
networks:
- ecommerce-net
volumes:
postgres-data:
redis-data:
grafana-data:
networks:
ecommerce-net:
driver: bridge