-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
251 lines (247 loc) · 8.43 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# TODO:
# check ports --> check
# Check db: can we merge dbs? not a good idea. its much easier to have them work seperately on 2 db image of postgres. see https://stackoverflow.com/questions/46668233/multiple-databases-in-docker-and-docker-compose
# check env varaibles --> check
# check web servers: nginx --> check
# network: what does the network part do?
version: '3'
services:
zookernel:
container_name: zoo.kernel
platform: linux/amd64
image: djayzen/zookernel:latest
#build: .
ports:
- "80:80"
volumes:
- ./zoo/docker/main.cfg:/usr/lib/cgi-bin/main.cfg
- ./zoo/docker/oas.cfg:/usr/lib/cgi-bin/oas.cfg
- ./zoo/docker/default.conf:/etc/apache2/sites-available/000-default.conf
# Uncomment below to expose a process named org.n52.javaps.test.EchoProcess
#- ./zoo-project/zoo-services/echo-py/cgi-env:/usr/lib/cgi-bin/org/n52/javaps/test
- ./zoo/zoo-project/zoo-services/echo-py/cgi-env/echo_service.py:/usr/lib/cgi-bin/echo_service.py
- ./zoo/zoo-project/zoo-services/echo-py/cgi-env/echo.zcfg:/usr/lib/cgi-bin/echo.zcfg
- ./zoo/zoo-project/zoo-services/utils/open-api/server/publish.py:/usr/lib/cgi-bin/publish.py
- ./zoo/zoo-project/zoo-services/utils/open-api/server/subscriber.py:/usr/lib/cgi-bin/subscriber.py
- ./zoo/docker/mapserver.conf:/mapserver/etc/mapserver.conf
- ./zoo/docker/.htaccess:/var/www/html/.htaccess
- ./zoo/zoo-project/zoo-services/utils/open-api/templates/index.html:/var/www/index.html
- ./zoo/zoo-project/zoo-services/utils/open-api/static:/var/www/html/static
- ./zoo/docker/com:/usr/com/zoo-project
- ./zoo/docker/tmp:/tmp/zTmp
depends_on:
- pgbouncer
- redis
- rabbitmq
environment:
- ZOO_REDIS_HOST=redis
zoofpm:
container_name: zoo.fpm
platform: linux/amd64
image: djayzen/zookernel:latest
volumes:
- ./zoo/docker/main.cfg:/usr/lib/cgi-bin/main.cfg
- ./zoo/docker/oas.cfg:/usr/lib/cgi-bin/oas.cfg
- ./zoo/docker/tmp:/tmp/zTmp
- ./zoo/docker/mapserver.conf:/mapserver/etc/mapserver.conf
- ./zoo/docker/com:/usr/com/zoo-project
# Uncomment below to expose a process named org.n52.javaps.test.EchoProcess
#- ./zoo/zoo-project/zoo-services/echo-py/cgi-env:/usr/lib/cgi-bin/org/n52/javaps/test
- ./zoo/zoo-project/zoo-services/echo-py/cgi-env/echo_service.py:/usr/lib/cgi-bin/echo_service.py
- ./zoo/zoo-project/zoo-services/echo-py/cgi-env/echo.zcfg:/usr/lib/cgi-bin/echo.zcfg
depends_on:
- rabbitmq
- pgbouncer
environment:
- ZOO_RABBITMQ_HOST=rabbitmq
command: [ "/startUp.sh" ]
websocketd:
container_name: zoo.websocketd
#platform: linux/amd64
build: ./zoo/docker/websocketd
depends_on:
- redis
ports:
- 8888:8888
environment:
- ZOO_REDIS_HOST=redis
volumes:
- ./zoo/zoo-project/zoo-services/utils/open-api/server/subscriber.py:/shell.py
command: ["--port=8888", "/shell.py"]
pg:
container_name: zoo.pg
#platform: linux/amd64
image: postgres:12.10-alpine
restart: always
environment:
POSTGRES_USER: zoo
POSTGRES_PASSWORD: zoo
POSTGRES_DB: zoo
volumes:
# Load the zoo kernel schema
- ./zoo/zoo-project/zoo-kernel/sql/schema.sql:/docker-entrypoint-initdb.d/1-schema.sql
# Load the async AMQP schema
- ./zoo/zoo-project/zoo-kernel/sql/async_amqp.sql:/docker-entrypoint-initdb.d/2-schema.sql
depends_on:
- rabbitmq
pgbouncer:
container_name: zoo.pgbouncer
#platform: linux/amd64
image: edoburu/pgbouncer:1.12.0
environment:
DATABASE_URL: "postgres://zoo:zoo@pg/zoo"
MAX_CLIENT_CONN: 1000
MAX_DB_CONNECTIONS: 100
DEFAULT_POOL_SIZE: 100
POOL_MODE: transaction
depends_on:
- pg
redis:
container_name: zoo.redis
image: redis:6.0.9
rabbitmq:
container_name: zoo.rabitmq
image: rabbitmq:3.8.9-management-alpine
volumes:
- ./zoo/docker/definitions.json:/etc/rabbitmq/definitions.json
####### eoapi services #####
stac:
container_name: eoapi.stac
build:
context: .
dockerfile: eoapi/dockerfiles/Dockerfile.stac
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8081:8081"
environment:
- APP_HOST=0.0.0.0
- APP_PORT=8081
- HOST=0.0.0.0
- PORT=8081
- ENVIRONMENT=local
# https://github.com/tiangolo/uvicorn-gunicorn-docker#web_concurrency
- WEB_CONCURRENCY=10
# https://github.com/tiangolo/uvicorn-gunicorn-docker#workers_per_core
# - WORKERS_PER_CORE=1
# https://github.com/tiangolo/uvicorn-gunicorn-docker#max_workers
# - MAX_WORKERS=10
# Postgres connection
- POSTGRES_USER=username
- POSTGRES_PASS=password
- POSTGRES_DBNAME=postgis
- POSTGRES_HOST_READER=database
- POSTGRES_HOST_WRITER=database
- POSTGRES_PORT=5432
- DB_MIN_CONN_SIZE=1
- DB_MAX_CONN_SIZE=10
# https://github.com/developmentseed/eoAPI/issues/16
# - TITILER_ENDPOINT=raster
- TITILER_ENDPOINT=http://127.0.0.1:8082
depends_on:
- database
- raster
command:
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
volumes:
- ./eoapi/dockerfiles/scripts:/tmp/scripts
raster:
container_name: eoapi.raster
# At the time of writing, rasterio and psycopg wheels are not available for arm64 arch
# so we force the image to be built with linux/amd64
platform: linux/amd64
build:
context: .
dockerfile: eoapi/dockerfiles/Dockerfile.raster
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8082:8082"
environment:
# Application
- HOST=0.0.0.0
- PORT=8082
# https://github.com/tiangolo/uvicorn-gunicorn-docker#web_concurrency
- WEB_CONCURRENCY=1
# https://github.com/tiangolo/uvicorn-gunicorn-docker#workers_per_core
- WORKERS_PER_CORE=1
# https://github.com/tiangolo/uvicorn-gunicorn-docker#max_workers
- MAX_WORKERS=10
# Postgres connection
- POSTGRES_USER=username
- POSTGRES_PASS=password
- POSTGRES_DBNAME=postgis
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- DB_MIN_CONN_SIZE=1
- DB_MAX_CONN_SIZE=10
# - DB_MAX_QUERIES=10
# - DB_MAX_IDLE=10
# GDAL Config
- CPL_TMPDIR=/tmp
- GDAL_CACHEMAX=75%
- GDAL_INGESTED_BYTES_AT_OPEN=32768
- GDAL_DISABLE_READDIR_ON_OPEN=EMPTY_DIR
- GDAL_HTTP_MERGE_CONSECUTIVE_RANGES=YES
- GDAL_HTTP_MULTIPLEX=YES
- GDAL_HTTP_VERSION=2
- VSI_CACHE=TRUE
- VSI_CACHE_SIZE=536870912
# TiTiler Config
- MOSAIC_CONCURRENCY=1
# AWS S3 endpoint config
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
# API Config
- EOAPI_RASTER_ENABLE_MOSAIC_SEARCH=TRUE
depends_on:
- database
command:
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
volumes:
- ./eoapi/dockerfiles/scripts:/tmp/scripts
vector:
container_name: eoapi.vector
build:
context: .
dockerfile: eoapi/dockerfiles/Dockerfile.vector
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:8083:8083"
environment:
# Application
- HOST=0.0.0.0
- PORT=8083
# https://github.com/tiangolo/uvicorn-gunicorn-docker#web_concurrency
- WEB_CONCURRENCY=10
# https://github.com/tiangolo/uvicorn-gunicorn-docker#workers_per_core
# - WORKERS_PER_CORE=1
# https://github.com/tiangolo/uvicorn-gunicorn-docker#max_workers
# - MAX_WORKERS=10
# Postgres connection
- POSTGRES_USER=username
- POSTGRES_PASS=password
- POSTGRES_DBNAME=postgis
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- DB_MIN_CONN_SIZE=1
- DB_MAX_CONN_SIZE=10
command:
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
depends_on:
- database
volumes:
- ./eoapi/dockerfiles/scripts:/tmp/scripts
database:
container_name: eoapi.db
image: ghcr.io/stac-utils/pgstac:v0.7.10
environment:
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgis
- PGUSER=username
- PGPASSWORD=password
- PGDATABASE=postgis
ports:
- "${MY_DOCKER_IP:-127.0.0.1}:5439:5432"
command: postgres -N 500
volumes:
- ./eoapi/.pgdata:/var/lib/postgresql/data
networks:
default:
name: eoapi-network