-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
108 lines (102 loc) · 2.41 KB
/
docker-compose.yaml
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
services:
inventory-db:
container_name: inventory-db
build:
context: srcs/postgres-db
restart: always
env_file: .env
volumes:
- inventory-database:/var/lib/postgresql/data
environment:
- DB_USER=${INVENTORY_DB_USER}
- DB_NAME=${INVENTORY_DB_NAME}
- DB_PASSWORD=${INVENTORY_DB_PASSWORD}
expose:
- 5432
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 3s
timeout: 1s
retries: 5
inventory-app:
container_name: inventory-app
restart: always
build:
context: srcs/inventory-app
env_file: .env
expose:
- ${INVENTORY_APP_PORT}
depends_on:
inventory-db:
condition: service_healthy
billing-db:
container_name: billing-db
build:
context: srcs/postgres-db
restart: always
volumes:
- billing-database:/var/lib/postgresql/data
environment:
- DB_USER=${BILLING_DB_USER}
- DB_NAME=${BILLING_DB_NAME}
- DB_PASSWORD=${BILLING_DB_PASSWORD}
expose:
- 5432
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 3s
timeout: 1s
retries: 5
billing-queue:
container_name: billing-queue
build:
context: srcs/rabbitmq
hostname: billing-queue
command: rabbitmq-server
restart: always
environment:
- RABBITMQ_USER=${RABBITMQ_USER}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
volumes:
- billing-queue:/var/lib/rabbitmq
expose:
- ${RABBITMQ_PORT}
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 5s
timeout: 5s
retries: 3
billing-app:
container_name: billing-app
build:
context: srcs/billing-app
env_file: .env
restart: always
environment:
- RABBITMQ_HOST=billing-queue
expose:
- ${BILLING_APP_PORT}
depends_on:
billing-db:
condition: service_healthy
billing-queue:
condition: service_healthy
api-gateway:
container_name: api-gateway
build:
context: srcs/api-gateway-app
restart: always
env_file: .env
environment:
- RABBITMQ_HOST=billing-queue
- INVENTORY_APP_HOST=inventory-app
- BILLING_APP_HOST=billing-app
ports:
- ${APIGATEWAY_PORT}:${APIGATEWAY_PORT}
depends_on:
billing-queue:
condition: service_healthy
volumes:
inventory-database:
billing-database:
billing-queue: