-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
144 lines (139 loc) · 3.09 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
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
x-kong-config: &kong-env
KONG_DATABASE: "postgres"
KONG_PG_HOST: kong-db
KONG_PG_PASSWORD: kong
KONG_PROXY_ACCESS_LOG: /dev/stdout
KONG_ADMIN_ACCESS_LOG: /dev/stdout
KONG_PROXY_ERROR_LOG: /dev/stderr
KONG_ADMIN_ERROR_LOG: /dev/stderr
KONG_ADMIN_LISTEN: 0.0.0.0:8001
KONG_ADMIN_GUI_URL: http://localhost:8002
KONG_DECLARATIVE_CONFIG: /opt/kong/kong.yaml
services:
postgres:
image: postgres:16
restart: always
environment:
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "postgres"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
kong-db:
image: postgres:16
restart: always
environment:
POSTGRES_DB: kong
POSTGRES_USER: kong
POSTGRES_PASSWORD: kong
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "postgres"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
# Nginx config
# nginx:
# image: nginx:latest
# restart: always
# depends_on:
# - order
# volumes:
# - ./app/api_gateway/nginx/conf.d:/etc/nginx/conf.d
# ports:
# - "8080:8080"
# - "50002:50002"
kong:
image: kong/kong-gateway:latest
restart: always
platform: linux/amd64
depends_on:
- kong-db
- webapp
environment:
<<: *kong-env
volumes:
# - ./app/api_gateway/kong/kong.conf:/etc/kong/kong.conf
- ./app/api_gateway/kong:/opt/kong
command: "kong start"
ports:
- "8002:8002"
- "8001:8001"
- "8000:8000"
kong-config:
build:
context: .
dockerfile: app/api_gateway/kong/Dockerfile
restart: always
depends_on:
kong:
condition: service_healthy
kong-migrations:
image: kong/kong-gateway:latest
command: kong migrations bootstrap
platform: linux/amd64
depends_on:
- kong-db
environment:
<<: *kong-env
restart: on-failure
kong-migrations-up:
image: kong/kong-gateway:latest
command: kong migrations up && kong migrations finish
platform: linux/amd64
depends_on:
- kong-db
environment:
<<: *kong-env
restart: on-failure
order:
build:
context: .
dockerfile: app/order/Dockerfile
restart: always
depends_on:
postgres:
condition: service_healthy
ports:
- "8888:8888"
pet:
build:
context: .
dockerfile: app/pet/Dockerfile
restart: always
depends_on:
postgres:
condition: service_healthy
webapp:
build:
context: ../frontend-app
dockerfile: ./Dockerfile
restart: always
depends_on:
- pet
ports:
- "3000:3000"
grpc-gateway:
build:
context: .
dockerfile: app/grpc_gateway/Dockerfile
restart: always
depends_on:
postgres:
condition: service_healthy
ports:
- "9090:9090"
user:
build:
context: .
dockerfile: app/user/Dockerfile
restart: always
depends_on:
postgres:
condition: service_healthy
env_file:
- app/user/.env
ports:
- "9999:9999"