-
Notifications
You must be signed in to change notification settings - Fork 45
/
docker-compose.yml
146 lines (140 loc) · 3.64 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
version: '3.9'
services:
# Planets service
planets-service:
image: kudryashovroman/graphql-rust:planets-service
container_name: planets-service
restart: always
depends_on:
- planets-db
environment:
SERVER_PORT: 8080
DATABASE_URL: postgres://postgres:$PLANETS_DB_PASSWORD@planets-db/planets
KAFKA_BROKER: kafka:9092
KAFKA_TOPIC: $KAFKA_TOPIC
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/" ]
interval: 10s
timeout: 3s
retries: 3
ports:
- "8001:8080"
planets-db:
image: postgres:16.3
container_name: planets-db
restart: always
environment:
POSTGRES_DB: planets
POSTGRES_PASSWORD: $PLANETS_DB_PASSWORD
healthcheck:
test: "pg_isready -U postgres -d planets"
interval: 10s
timeout: 3s
retries: 3
ports:
- "5491:5432"
# Satellites service
satellites-service:
image: kudryashovroman/graphql-rust:satellites-service
container_name: satellites-service
restart: always
depends_on:
- satellites-db
environment:
SERVER_PORT: 8080
DATABASE_URL: postgres://postgres:$SATELLITES_DB_PASSWORD@satellites-db/satellites
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/" ]
interval: 10s
timeout: 3s
retries: 3
ports:
- "8002:8080"
satellites-db:
image: postgres:16.3
container_name: satellites-db
restart: always
environment:
POSTGRES_DB: satellites
POSTGRES_PASSWORD: $SATELLITES_DB_PASSWORD
healthcheck:
test: "pg_isready -U postgres -d satellites"
interval: 10s
timeout: 3s
retries: 3
ports:
- "5492:5432"
# Auth service
auth-service:
image: kudryashovroman/graphql-rust:auth-service
container_name: auth-service
restart: always
depends_on:
- users-db
environment:
SERVER_PORT: 8080
DATABASE_URL: postgres://postgres:$USERS_DB_PASSWORD@users-db/users
JWT_SECRET_KEY: $JWT_SECRET_KEY
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/" ]
interval: 10s
timeout: 3s
retries: 3
ports:
- "8003:8080"
users-db:
image: postgres:16.3
container_name: users-db
restart: always
environment:
POSTGRES_DB: users
POSTGRES_PASSWORD: $USERS_DB_PASSWORD
healthcheck:
test: "pg_isready -U postgres -d users"
interval: 10s
timeout: 3s
retries: 3
ports:
- "5493:5432"
gateway:
image: kudryashovroman/graphql-rust:gateway
container_name: gateway
restart: always
depends_on:
- planets-service
- satellites-service
- auth-service
environment:
APOLLO_ROUTER_SUPERGRAPH_PATH: /gateway/schema/supergraph.graphql
APOLLO_ROUTER_CONFIG_PATH: /gateway/config/router.yaml
APOLLO_ROUTER_LOG: debug
APOLLO_TELEMETRY_DISABLED: true
JWT_SECRET_KEY: $JWT_SECRET_KEY
volumes:
- ./gateway/supergraph.graphql:/gateway/schema/supergraph.graphql
- ./gateway/router.yaml:/gateway/config/router.yaml
ports:
- "4000:4000"
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
restart: always
healthcheck:
test: [ "CMD", "nc", "-vz", "localhost", "2181" ]
interval: 10s
timeout: 3s
retries: 3
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
container_name: kafka
restart: always
depends_on:
- zookeeper
environment:
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "$KAFKA_TOPIC:1:1"
ports:
- "9092:9092"