Skip to content

Commit adb7820

Browse files
francbartoliFrancesco Bartolihrodmn
authored
Fix titiler external endpoints (#33)
* Update titiler-pgstac docker image version and enable external endpoints * Align stac-browser config according to titiler-stac external url * Bump titiler-pgstac to the last released version --------- Co-authored-by: Francesco Bartoli <[email protected]> Co-authored-by: hrodmn <[email protected]>
1 parent e3cfb85 commit adb7820

File tree

2 files changed

+38
-46
lines changed

2 files changed

+38
-46
lines changed

docker-compose.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
version: '3'
1+
version: "3"
22

33
services:
4-
54
# change to official image when available https://github.com/radiantearth/stac-browser/pull/386
65
stac-browser:
76
build:
@@ -47,16 +46,15 @@ services:
4746
- DB_MAX_CONN_SIZE=10
4847
depends_on:
4948
- database
50-
command:
51-
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
49+
command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
5250
volumes:
5351
- ./dockerfiles/scripts:/tmp/scripts
5452

5553
raster:
5654
# At the time of writing, rasterio and psycopg wheels are not available for arm64 arch
5755
# so we force the image to be built with linux/amd64
5856
platform: linux/amd64
59-
image: ghcr.io/stac-utils/titiler-pgstac:1.2.2
57+
image: ghcr.io/stac-utils/titiler-pgstac:1.8.0
6058
ports:
6159
- "${MY_DOCKER_IP:-127.0.0.1}:8082:8082"
6260
environment:
@@ -91,13 +89,13 @@ services:
9189
- VSI_CACHE_SIZE=536870912
9290
# TiTiler Config
9391
- MOSAIC_CONCURRENCY=1
92+
- TITILER_PGSTAC_API_ENABLE_EXTERNAL_DATASET_ENDPOINTS=True
9493
# AWS S3 endpoint config
9594
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
9695
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
9796
depends_on:
9897
- database
99-
command:
100-
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
98+
command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && gunicorn -k uvicorn.workers.UvicornWorker titiler.pgstac.main:app --bind 0.0.0.0:8082 --workers 1"
10199
volumes:
102100
- ./dockerfiles/scripts:/tmp/scripts
103101

@@ -123,8 +121,7 @@ services:
123121
- POSTGRES_PORT=5432
124122
- DB_MIN_CONN_SIZE=1
125123
- DB_MAX_CONN_SIZE=10
126-
command:
127-
bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
124+
command: bash -c "bash /tmp/scripts/wait-for-it.sh -t 120 -h database -p 5432 && /start.sh"
128125
depends_on:
129126
- database
130127
volumes:

dockerfiles/browser_config.js

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
11
module.exports = {
2-
catalogUrl: "http://0.0.0.0:8081",
3-
catalogTitle: "eoAPI STAC Browser",
4-
allowExternalAccess: true, // Must be true if catalogUrl is not given
5-
allowedDomains: [],
6-
detectLocaleFromBrowser: true,
7-
storeLocale: true,
8-
locale: "en",
9-
fallbackLocale: "en",
10-
supportedLocales: [
11-
"de",
12-
"es",
13-
"en",
14-
"fr",
15-
"it",
16-
"ro"
17-
],
18-
apiCatalogPriority: null,
19-
useTileLayerAsFallback: true,
20-
displayGeoTiffByDefault: false,
21-
buildTileUrlTemplate: ({href, asset}) => "http://0.0.0.0:8082/cog/tiles/{z}/{x}/{y}@2x?url=" + encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href),
22-
stacProxyUrl: null,
23-
pathPrefix: "/",
24-
historyMode: "history",
25-
cardViewMode: "cards",
26-
cardViewSort: "asc",
27-
showThumbnailsAsAssets: false,
28-
stacLint: true,
29-
geoTiffResolution: 128,
30-
redirectLegacyUrls: false,
31-
itemsPerPage: 12,
32-
defaultThumbnailSize: null,
33-
maxPreviewsOnMap: 50,
34-
crossOriginMedia: null,
35-
requestHeaders: {},
36-
requestQueryParameters: {},
37-
preprocessSTAC: null,
38-
authConfig: null
2+
catalogUrl: "http://localhost:8081",
3+
catalogTitle: "eoAPI STAC Browser",
4+
allowExternalAccess: true, // Must be true if catalogUrl is not given
5+
allowedDomains: [],
6+
detectLocaleFromBrowser: true,
7+
storeLocale: true,
8+
locale: "en",
9+
fallbackLocale: "en",
10+
supportedLocales: ["de", "es", "en", "fr", "it", "ro"],
11+
apiCatalogPriority: null,
12+
useTileLayerAsFallback: false,
13+
displayGeoTiffByDefault: false,
14+
buildTileUrlTemplate: ({ href, asset }) =>
15+
"http://localhost:8082/external/tiles/WebMercatorQuad/{z}/{x}/{y}@2x?url=" +
16+
encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href),
17+
stacProxyUrl: null,
18+
pathPrefix: "/",
19+
historyMode: "history",
20+
cardViewMode: "cards",
21+
cardViewSort: "asc",
22+
showThumbnailsAsAssets: false,
23+
stacLint: true,
24+
geoTiffResolution: 128,
25+
redirectLegacyUrls: false,
26+
itemsPerPage: 12,
27+
defaultThumbnailSize: null,
28+
maxPreviewsOnMap: 50,
29+
crossOriginMedia: null,
30+
requestHeaders: {},
31+
requestQueryParameters: {},
32+
preprocessSTAC: null,
33+
authConfig: null,
3934
};

0 commit comments

Comments
 (0)