forked from juicycleff/ultimate-backend-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
199 lines (187 loc) · 4.67 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
version: '3.8'
services:
nighthawk:
image: 'ub-boilerplate/nighthawk-migrate-cmd'
build:
context: .
args:
APP_NAME: nighthawk
OPTIONS: migrate db
dockerfile: .deploy/cli-base.Dockerfile
links:
- redis
- kratos
- postgresd
ports:
- '5556:5556'
container_name: nighthawk-cmd
environment:
REDIS_URL: redis://redis:6379
DATABASE_URL: 'postgresql://kratos:secret@postgresd:5432/guardian_db?schema=ub-schema'
depends_on:
- kratos
- redis
- postgresd
networks:
- intranet
guardian:
image: 'ub-boilerplate/guardian'
build:
context: .
args:
APP_NAME: guardian
PORT: 5000
dockerfile: .deploy/base.Dockerfile
links:
- redis
- kratos
- postgresd
ports:
- '5000:5000'
container_name: guardian-svc
environment:
REDIS_URL: redis://redis:6379
DATABASE_URL: 'postgresql://kratos:secret@postgresd:5432/guardian_db?schema=ub-schema'
depends_on:
- kratos
- redis
- postgresd
- nighthawk
networks:
- intranet
billing:
image: 'ub-boilerplate/billing'
build:
context: .
args:
APP_NAME: billing
PORT: 5002
dockerfile: .deploy/base.Dockerfile
links:
- redis
ports:
- '5002:5002'
container_name: billing-svc
environment:
REDIS_URL: redis://redis:6379
DATABASE_URL: 'postgresql://kratos:secret@postgresd:5432/guardian_db?schema=ub-schema'
UB_ENABLE_K8S: false
depends_on:
- kratos
- redis
- nighthawk
networks:
- intranet
application:
image: 'ub-boilerplate/application'
build:
context: .
args:
APP_NAME: application
PORT: 3333
dockerfile: .deploy/base.Dockerfile
environment:
REDIS_URL: redis://redis:6379
DATABASE_URL: 'postgresql://kratos:secret@postgresd:5432/guardian_db?schema=ub-schema'
links:
- redis
ports:
- '3333:3333'
container_name: application-svc
depends_on:
- kratos
- redis
- nighthawk
networks:
- intranet
################################## KRATOS START #################################
kratos-migrate:
container_name: kratos-migrate
image: oryd/kratos:latest
command: migrate -c /etc/config/kratos/kratos.yml sql -e --yes
volumes:
- type: bind
source: ./.deploy/ory/config
target: /etc/config/kratos
environment:
- DSN=postgres://kratos:secret@postgresd:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4
depends_on:
- postgresd
networks:
- intranet
kratos:
image: oryd/kratos:latest
container_name: kratos
ports:
- '4433:4433'
- '4434:4434'
command: serve --config /etc/config/kratos/kratos.yml all
volumes:
- type: bind
source: ./.deploy/ory/config
target: /etc/config/kratos
environment:
- DSN=postgres://kratos:secret@postgresd:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4
depends_on:
- kratos-migrate
- postgresd
- zipkin
links:
- zipkin
networks:
- intranet
################################## KRATOS START #################################
################################# KRAKEND START #################################
krakend:
container_name: krakend
image: devopsfaith/krakend:config-watcher
command: run -d -c /etc/krakend/krakend.json
ports:
- '8080:8080'
networks:
- intranet
volumes:
- ./.deploy/krakend:/etc/krakend
################################## KRAKEND END ##################################
############################### THIRD-PARTY START ###############################
postgresd:
container_name: postgresd
image: postgres:9.6
volumes:
- ./scripts/pg-init-scripts:/docker-entrypoint-initdb.d
ports:
- '5432:5432'
environment:
- POSTGRES_MULTIPLE_DATABASES=guardian_db,organisation_db,billing_db
- POSTGRES_USER=kratos
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=kratos
networks:
- intranet
redis:
container_name: redis
image: bitnami/redis
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '6379:6379'
networks:
- intranet
mongo:
container_name: mongo
image: mongo:latest
ports:
- '27017:27017'
networks:
- intranet
zipkin:
container_name: zipkin
ports:
- '9411:9411'
image: openzipkin/zipkin
networks:
- intranet
################################ THIRD-PARTY END ################################
networks:
intranet:
driver: bridge