-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
114 lines (108 loc) · 2.47 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
version: '3.7'
volumes:
postgres-user:
driver: local
postgres-customer:
driver: local
postgres-flight:
driver: local
postgres-booking:
driver: local
services:
# graphql server
graphql:
build:
context: .
dockerfile: Dockerfile
depends_on:
- user-service
- customer-service
- flight-service
- booking-service
restart: always
ports:
- "3000:3000"
# user service gRPC
user-service:
build:
context: .
dockerfile: ./grpc/user-grpc/user.Dockerfile
depends_on:
- user-db
restart: always
ports:
- "2224:2224"
user-db:
image: postgres:alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres-user:/var/lib/postgresql/data
- "./scripts/user-init.sql:/docker-entrypoint-initdb.d/user-init.sql"
ports:
- "5432:5432"
# flight service gRPC
flight-service:
build:
context: .
dockerfile: ./grpc/flight-grpc/flight.Dockerfile
depends_on:
- flight-db
restart: always
ports:
- "2222:2222"
flight-db:
image: postgres:alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres-flight:/var/lib/postgresql/data
- "./scripts/flight-init.sql:/docker-entrypoint-initdb.d/flight-init.sql"
ports:
- "5433:5432"
# customer service gRPC
customer-service:
build:
context: .
dockerfile: ./grpc/customer-grpc/customer.Dockerfile
depends_on:
- customer-db
restart: always
ports:
- "2223:2223"
customer-db:
image: postgres:alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres-customer:/var/lib/postgresql/data
- "./scripts/customer-init.sql:/docker-entrypoint-initdb.d/customer-init.sql"
ports:
- "5434:5432"
# booking service gRPC
booking-service:
build:
context: .
dockerfile: ./grpc/booking-grpc/booking.Dockerfile
depends_on:
- booking-db
restart: always
ports:
- "2225:2225"
booking-db:
image: postgres:alpine
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres-booking:/var/lib/postgresql/data
- "./scripts/booking-init.sql:/docker-entrypoint-initdb.d/booking-init.sql"
ports:
- "5435:5432"