-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
148 lines (138 loc) · 3.49 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
138
139
140
141
142
143
144
145
146
147
148
version: "3"
services:
api-gateway:
image: nginx:latest
container_name: api-gateway
ports:
- "80:80"
networks:
- gateway-network
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./jwt-auth.lua:/etc/nginx/jwt-auth.lua:ro
depends_on:
- auth-api
- orders-api
- delivery-api
build:
dockerfile: Dockerfile
args:
- JWT_SECRET=4fcfc25be07f50a0f0f6214df8b495c0
auth-api:
build:
context: ./auth_api
dockerfile: Dockerfile
container_name: auth-api
env_file:
- ./auth_api/.env
environment:
- DB_CONNECTION_STRING=user=admin password=pass dbname=users_db sslmode=disable host=users-db
- JWT_SECRET=4fcfc25be07f50a0f0f6214df8b495c0
depends_on:
- users-db
networks:
- gateway-network
ports:
- "3000"
users-db:
image: postgres:latest
container_name: users-db
networks:
- gateway-network
environment:
- POSTGRES_DB=users_db
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=pass
ports:
- "5432:5432"
orders-api:
build:
context: ./orders_api
dockerfile: Dockerfile
container_name: orders-api
env_file:
- ./orders_api/.env
depends_on:
- orders-mongo
- orders-db
- rabbitmq
environment:
- DB_CONNECTION_STRING=user=admin password=pass dbname=orders_db sslmode=disable host=orders-db port=5433
- JWT_SECRET=4fcfc25be07f50a0f0f6214df8b495c0
- MONGO_URI=mongodb://admin:pass@orders-mongo:27017
- MONGO_DATABASE=orders_mongo_db
- RABBIT_CONNECTION=amqp://guest:guest@rabbitmq:5672/
- RABBIT_DELIVERY_QUEUE=MS_DELIVERY_QUEUE
- RABBIT_ORDER_QUEUE=RABBIT_ORDER_QUEUE
- URL_GET_ESTABLISHMENT_ID=http://api-gateway/api/auth/establishments/%d
networks:
- gateway-network
ports:
- "3000"
orders-db:
image: postgres:latest
container_name: orders-db
networks:
- gateway-network
environment:
- POSTGRES_DB=orders_db
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=pass
ports:
- "5433:5433"
command: -p 5433
orders-mongo:
image: mongo:latest
command: mongod --auth
container_name: orders-mongo
networks:
- gateway-network
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=pass
- MONGO_INITDB_DATABASE=orders_mongo_db
ports:
- "27017:27017"
delivery-api:
build:
context: ./delivery_api
dockerfile: Dockerfile
container_name: delivery-api
env_file:
- ./delivery_api/.env
depends_on:
- delivery-mongo
- rabbitmq
environment:
- RABBIT_CONNECTION=amqp://guest:guest@rabbitmq:5672/
- RABBIT_DELIVERY_QUEUE=MS_DELIVERY_QUEUE
- RABBIT_ORDER_QUEUE=RABBIT_ORDER_QUEUE
- MONGO_URI=mongodb://admin:pass@delivery-mongo:27017
- MONGO_DATABASE=delivery_mongo_db
networks:
- gateway-network
ports:
- "3000"
delivery-mongo:
image: mongo:latest
command: mongod --auth
container_name: delivery-mongo
networks:
- gateway-network
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=pass
- MONGO_INITDB_DATABASE=delivery_mongo_db
ports:
- "27018:27017"
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
networks:
- gateway-network
ports:
- "5672:5672"
- "15672:15672"
networks:
gateway-network:
driver: bridge