-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
137 lines (126 loc) · 2.91 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
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
135
136
137
services:
# User Service
mongo-user:
image: mongo:latest
container_name: mongo-user
ports:
- "27018:27017"
networks:
- app-network
goapp-user:
build: ./user-service # Path to the user service Dockerfile
container_name: goapp-user
ports:
- "8080:8080"
depends_on:
- mongo-user
environment:
- MONGO_URI=mongodb://mongo-user:27017/
networks:
- app-network
# Product Service
mongo-product:
image: mongo:latest
container_name: mongo-product
ports:
- "27019:27017"
networks:
- app-network
goapp-product:
build: ./product-service # Path to the product service Dockerfile
container_name: goapp-product
ports:
- "8081:8081"
depends_on:
- mongo-product
environment:
- MONGO_URI=mongodb://mongo-product:27017/
networks:
- app-network
#payment-service
mongo-payment:
image: mongo:latest
container_name: mongo-payment
ports:
- "27021:27017"
networks:
- app-network
goapp-payment:
build: ./payment-service # Path to the payment service Dockerfile
container_name: goapp-payment
ports:
- "8082:8082"
depends_on:
- mongo-payment
environment:
- MONGO_URI=mongodb://mongo-payment:27017/
networks:
- app-network
#order-service
mongo-order:
image: mongo:latest
container_name: mongo-order
ports:
- "27022:27017"
networks:
- app-network
goapp-order:
build: ./order-service # Path to the order service Dockerfile
container_name: goapp-order
ports:
- "8083:8083"
depends_on:
- mongo-order
environment:
- MONGO_URI=mongodb://mongo-order:27017/
networks:
- app-network
#notification service
goapp-notification:
build: ./notification-service # Path to the notification service Dockerfile
container_name: goapp-notification
ports:
- "8084:8084"
env_file:
- ./notification-service/.env #Relative patch to twilio credentials
networks:
- app-network
#cart service
mongo-cart:
image: mongo:latest
container_name: mongo-cart
ports:
- "27023:27017"
networks:
- app-network
goapp-cart:
build: ./cart-service # Path to the cart service Dockerfile
container_name: goapp-cart
ports:
- "8085:8085"
depends_on:
- mongo-cart
environment:
- MONGO_URI=mongodb://mongo-cart:27017/
networks:
- app-network
# NGINX Gateway
nginx-gateway:
image: nginx:latest
container_name: nginx-gateway
ports:
- "82:80"
volumes:
- /home/harsh/EcommerceApi/nginx/api_gateway.conf:/etc/nginx/nginx.conf # Correct path
depends_on:
- goapp-user
- goapp-product
- goapp-payment
- goapp-order
- goapp-notification
- goapp-cart
networks:
- app-network
networks:
app-network:
driver: bridge