-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
148 lines (138 loc) · 4.27 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
# Copyright © 2021-2025 Geospatial Research Institute Toi Hangarau
# LICENSE: https://github.com/GeospatialResearch/Digital-Twins/blob/master/LICENSE
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Defines services, their images, and interactions between services.
volumes:
postgres_db_vol:
stored_data:
geoserver_data:
services:
db_postgres:
# Database to store all vector data, states, and links to raster data.
image: postgis/postgis:16-3.4
container_name: db_postgres_digital_twin
restart: always
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- postgres_db_vol:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
healthcheck:
test: pg_isready -h 127.0.0.1 -U $POSTGRES_USER -d $POSTGRES_DB
backend:
# Performs analysis, computation, handles web requests, facilitates database interactions
build:
context: .
target: backend
image: lparkinson/backend-flood-resilience-dt:1.3
container_name: backend_digital_twin
env_file:
- .env
- api_keys.env
- .env.docker-override
volumes:
- stored_data:/stored_data
healthcheck:
test: curl --fail -s http://localhost:5000/ || exit 1
interval: 10s
timeout: 5s
retries: 10
ports:
- "5000:5000"
depends_on:
- db_postgres
- message_broker
- geoserver
celery_worker:
# Performs tasks such as complex computation asynchronously on behalf of backend
build:
context: .
target: celery_worker
image: lparkinson/celery-flood-resilience-dt:1.3
container_name: celery_worker_digital_twin
restart: always
env_file:
- .env
- api_keys.env
- .env.docker-override
volumes:
# Bind host data directories to container, allowing different instances to share data sources.
- stored_data:/stored_data
- geoserver_data:/stored_data/geoserver
ports:
- "5001:5001"
healthcheck:
test: curl --fail -s http://localhost:5001/ || exit 1
interval: 10s
timeout: 5s
retries: 10
depends_on:
- db_postgres
- message_broker
- geoserver
geoserver:
# Serves geospatial web data through interactions with files and database
build:
context: .
target: geoserver
image: lparkinson/geoserver-flood-resilience-dt:1.2
container_name: geoserver_digital_twin
volumes:
- geoserver_data:/opt/geoserver_data
depends_on:
- db_postgres
environment:
- SKIP_DEMO_DATA=true
- CORS_ENABLED=true
- ROOT_WEBAPP_REDIRECT=true
ports:
- "${GEOSERVER_PORT}:8080"
restart: always
healthcheck:
test: curl --fail -s http://localhost:8080/geoserver || exit 1
timeout: 5s
retries: 10
www:
# Webserver for the website interface
image: lparkinson/www-flood-resilience-dt:1.3.1
build:
context: .
dockerfile: visualisation/Dockerfile
container_name: www_digital_twin
environment:
- VUE_APP_CESIUM_ACCESS_TOKEN=$CESIUM_ACCESS_TOKEN
- VUE_APP_GEOSERVER_HOST=$GEOSERVER_HOST
- VUE_APP_GEOSERVER_PORT=$GEOSERVER_PORT
- VUE_APP_POSTGRES_DB=$POSTGRES_DB
ports:
- "${WWW_PORT}:80"
healthcheck:
test: curl --fail -s http://localhost:80/ || exit 1
timeout: 5s
retries: 10
message_broker:
# Communicates between backend and workers to assign tasks and store state
image: redis:7
container_name: message_broker_digital_twin
ports:
- "6379:6379"
healthcheck:
test: redis-cli ping | grep PONG
timeout: 1s
retries: 10
restart: always