-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
183 lines (174 loc) · 5.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
183 lines (174 loc) · 5.17 KB
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
services:
database:
image: ghcr.io/stac-utils/pgstac:v0.9.10
environment:
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgis
- PGUSER=username
- PGPASSWORD=password
- PGDATABASE=postgis
ports:
- 5439:5432
command: postgres -N 500
volumes:
- pgdata:/var/lib/postgresql/data
features-loader:
image: ghcr.io/osgeo/gdal:ubuntu-small-latest
depends_on:
database:
condition: service_started
environment:
- PGHOST=database
- PGUSER=username
- PGPASSWORD=password
- PGDATABASE=postgis
- PGPORT=5432
command: >
/bin/bash -c '
if [ ! -f /tmp/features_loaded ]; then
apt-get update && apt-get install -y postgresql-client &&
sleep 5 && # Give the database time to start
psql -c "CREATE SCHEMA IF NOT EXISTS features;" &&
psql -c "DROP TABLE IF EXISTS features.ecoregions;" &&
ogr2ogr -f PostgreSQL \
PG:dbname=$${PGDATABASE} \
/vsizip/vsicurl/https://dmap-prod-oms-edc.s3.us-east-1.amazonaws.com/ORD/Ecoregions/cec_na/NA_CEC_Eco_Level3.zip/NA_CEC_Eco_Level3.shp \
-nln features.ecoregions \
-t_srs EPSG:4326 \
-lco GEOMETRY_NAME=geom \
-lco FID=id \
-lco PRECISION=NO \
-nlt PROMOTE_TO_MULTI &&
touch /tmp/features_loaded
else
echo "Features already loaded. Skipping."
fi
echo "Features loading process completed successfully" > /tmp/health_status
# Keep the container running but doing nothing
tail -f /dev/null
'
volumes:
- feature-loader-state:/tmp
healthcheck:
test: ["CMD-SHELL", "[ -f /tmp/features_loaded ] && [ -f /tmp/health_status ] && echo 'Features loaded successfully' || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 120s
stac-fastapi:
image: ghcr.io/stac-utils/stac-fastapi-pgstac:6.2.2
ports:
- 8081:8081
environment:
# 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=1
depends_on:
database:
condition: service_started
features-loader:
condition: service_healthy
command:
bash -c "uvicorn stac_fastapi.pgstac.app:app --host 0.0.0.0 --port 8081"
titiler-pgstac:
platform: linux/amd64
image: ghcr.io/stac-utils/titiler-pgstac:3.0.0
ports:
- 8082:8082
environment:
# Postgres connection
- PGUSER=username
- PGPASSWORD=password
- PGDATABASE=postgis
- PGHOST=database
- PGPORT=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
- TITILER_PGSTAC_API_ENABLE_EXTERNAL_DATASET_ENDPOINTS=True
# AWS S3 endpoint config — the workshop's s3:// assets (glad collection)
# are in public buckets; read unsigned unless real credentials are provided
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_NO_SIGN_REQUEST=${AWS_NO_SIGN_REQUEST:-YES}
depends_on:
database:
condition: service_started
features-loader:
condition: service_healthy
command:
bash -c "uvicorn titiler.pgstac.main:app --host 0.0.0.0 --port 8082"
tipg:
image: ghcr.io/developmentseed/tipg:1.4.0
ports:
- 8083:8083
environment:
# 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
- TIPG_DB_SCHEMAS=["features"]
command:
bash -c "uvicorn tipg.main:app --host 0.0.0.0 --port 8083"
depends_on:
database:
condition: service_started
features-loader:
condition: service_healthy
stac-browser:
image: ghcr.io/radiantearth/stac-browser:latest
ports:
- 8080:8080
environment:
SB_catalogUrl: "http://0.0.0.0:8081"
depends_on:
- stac-fastapi
- database
jupyterhub:
build:
context: .
dockerfile: Dockerfile.local
ports:
- 8888:8888
volumes:
- ./docs:/home/jovyan/docs
environment:
- PGHOST=database
- PGUSER=username
- PGPASSWORD=password
- PGDATABASE=postgis
- PGPORT=5432
- STAC_API_ENDPOINT=http://stac-fastapi:8081
- TITILER_PGSTAC_API_ENDPOINT=http://titiler-pgstac:8082
- TIPG_API_ENDPOINT=http://tipg:8083
- STAC_BROWSER_ENDPOINT=http://localhost:8080
volumes:
pgdata:
feature-loader-state:
networks:
default:
name: eoapi-network