generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
202 lines (194 loc) · 4.24 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
200
201
202
---
version: "3.8"
networks:
app-tier:
driver: bridge
services:
database:
user: postgres
networks:
- app-tier
container_name: database
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: default
hostname: database
image: postgis/postgis:15-3.3
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
volumes:
- /pgdata
users:
networks:
- app-tier
build:
context: backend/users
dockerfile: ./local.Dockerfile
container_name: users
hostname: users
links:
- database
ports:
- "4005:4005"
depends_on:
database:
condition: service_healthy
expose:
- 4005
volumes:
- ./backend/users:/app:z
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:4005" ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
applications:
networks:
- app-tier
build:
context: backend/applications
dockerfile: ./local.Dockerfile
container_name: applications
hostname: applications
depends_on:
database:
condition: service_healthy
links:
- database
ports:
- "4006:4006"
expose:
- 4006
volumes:
- ./backend/applications:/app:z
- /app/node_modules
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:4006" ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
site-database:
image: postgres/postgis-debezium:15
user: postgres
networks:
- app-tier
container_name: site-database
build:
context: etl/debezium-postgis/15-3.3
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: default
hostname: site-database
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 30s
timeout: 25s
retries: 5
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
sites:
networks:
- app-tier
build:
context: backend/sites
dockerfile: ./local.Dockerfile
container_name: sites
hostname: sites
depends_on:
site-database:
condition: service_healthy
links:
- site-database
ports:
- "4007:4007"
expose:
- 4007
volumes:
- ./backend/sites:/app:z
- /app/node_modules
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:4007" ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
graphqlgateway:
networks:
- app-tier
container_name: graphqlgateway
build:
context: backend/gateway
environment:
NODE_ENV: development
POSTGRESQL_HOST: database
POSTGRESQL_USER: default
POSTGRESQL_PASSWORD: default
POSTGRESQL_DATABASE: default
USERS_MICROSERVICE: http://users:4005
SITE_MICROSERVICE: http://sites:4007
USERS_MICROSERVICE_ENDPOINT: http://users:4005/graphql
SITE_MICROSERVICE_ENDPOINT: http://sites:4007/graphql
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:4010" ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
hostname: graphqlgateway
image: node:14
links:
- database
- site-database
ports:
- "4010:4010"
depends_on:
- "users"
- "sites"
volumes:
- ./backend/gateway:/app:z
- /app/node_modules
working_dir: "/app"
frontend:
container_name: frontend
entrypoint:
- "sh"
- "-c"
- "npm i && npm run start"
environment:
- WATCHPACK_POLLING=true
- NODE_ENV=development
- BACKEND_URL=backend
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:4000" ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
hostname: frontend
image: node:14
links:
- graphqlgateway
ports:
- "4000:3000"
- "35729:35729"
volumes:
- ./frontend:/app:z
- /app/node_modules
working_dir: "/app"
userapi_doc:
container_name: userapi_doc
build:
context: ./backend/documentation/users
dockerfile: ./Dockerfile
restart: always
ports:
- "4001:4001"