-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from developmentseed/feat/stac-browser-tiler
- add stac browser to docker deployment - make use of radiant earth browser config to have control over which tiler is used - create a separate settings object for the browser for readability
- Loading branch information
Showing
8 changed files
with
158 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright Radiant Earth Foundation | ||
|
||
FROM node:lts-alpine3.18 AS build-step | ||
ARG DYNAMIC_CONFIG=true | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache git | ||
RUN git clone https://github.com/radiantearth/stac-browser.git . | ||
# remove the default config.js | ||
RUN rm config.js | ||
RUN npm install | ||
# replace the default config.js with our config file | ||
COPY ./browser_config.js ./config.js | ||
RUN \[ "${DYNAMIC_CONFIG}" == "true" \] && sed -i 's/<!-- <script defer="defer" src=".\/config.js"><\/script> -->/<script defer="defer" src=".\/config.js"><\/script>/g' public/index.html | ||
RUN npm run build | ||
|
||
|
||
FROM nginx:1-alpine-slim | ||
|
||
COPY --from=build-step /app/dist /usr/share/nginx/html | ||
COPY --from=build-step /app/config.schema.json /etc/nginx/conf.d/config.schema.json | ||
|
||
# change default port to 8084 | ||
RUN apk add jq pcre-tools && \ | ||
sed -i 's/\s*listen\s*80;/ listen 8084;/' /etc/nginx/conf.d/default.conf && \ | ||
sed -i 's/\s*location \/ {/ location \/ {\n try_files $uri $uri\/ \/index.html;/' /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 8084 | ||
|
||
STOPSIGNAL SIGTERM | ||
|
||
# override entrypoint, which calls nginx-entrypoint underneath | ||
COPY --from=build-step /app/docker/docker-entrypoint.sh ./docker-entrypoint.d/40-stac-browser-entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = { | ||
catalogUrl: "http://0.0.0.0:8081", | ||
catalogTitle: "eoAPI STAC Browser", | ||
allowExternalAccess: true, // Must be true if catalogUrl is not given | ||
allowedDomains: [], | ||
detectLocaleFromBrowser: true, | ||
storeLocale: true, | ||
locale: "en", | ||
fallbackLocale: "en", | ||
supportedLocales: [ | ||
"de", | ||
"es", | ||
"en", | ||
"fr", | ||
"it", | ||
"ro" | ||
], | ||
apiCatalogPriority: null, | ||
useTileLayerAsFallback: true, | ||
displayGeoTiffByDefault: false, | ||
buildTileUrlTemplate: ({href, asset}) => "http://0.0.0.0:8082/cog/tiles/{z}/{x}/{y}@2x?url=" + encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href), | ||
stacProxyUrl: null, | ||
pathPrefix: "/", | ||
historyMode: "history", | ||
cardViewMode: "cards", | ||
cardViewSort: "asc", | ||
showThumbnailsAsAssets: false, | ||
stacLint: true, | ||
geoTiffResolution: 128, | ||
redirectLegacyUrls: false, | ||
itemsPerPage: 12, | ||
defaultThumbnailSize: null, | ||
maxPreviewsOnMap: 50, | ||
crossOriginMedia: null, | ||
requestHeaders: {}, | ||
requestQueryParameters: {}, | ||
preprocessSTAC: null, | ||
authConfig: null | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = { | ||
catalogUrl: null, | ||
catalogTitle: "eoAPI STAC Browser", | ||
allowExternalAccess: true, // Must be true if catalogUrl is not given | ||
allowedDomains: [], | ||
detectLocaleFromBrowser: true, | ||
storeLocale: true, | ||
locale: "en", | ||
fallbackLocale: "en", | ||
supportedLocales: [ | ||
"de", | ||
"es", | ||
"en", | ||
"fr", | ||
"it", | ||
"ro" | ||
], | ||
apiCatalogPriority: null, | ||
useTileLayerAsFallback: true, | ||
displayGeoTiffByDefault: false, | ||
buildTileUrlTemplate: ({href, asset}) => "https://raster.dev/cog/tiles/{z}/{x}/{y}@2x?url=" + encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href), | ||
stacProxyUrl: null, | ||
pathPrefix: "/", | ||
historyMode: "history", | ||
cardViewMode: "cards", | ||
cardViewSort: "asc", | ||
showThumbnailsAsAssets: false, | ||
stacLint: true, | ||
geoTiffResolution: 128, | ||
redirectLegacyUrls: false, | ||
itemsPerPage: 12, | ||
defaultThumbnailSize: null, | ||
maxPreviewsOnMap: 50, | ||
crossOriginMedia: null, | ||
requestHeaders: {}, | ||
requestQueryParameters: {}, | ||
preprocessSTAC: null, | ||
authConfig: null | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ boto3==1.28.71 | |
# pydantic settings | ||
pydantic~=2.0 | ||
pydantic-settings~=2.0 | ||
eoapi-cdk==6.0.0 | ||
eoapi-cdk==6.1.0 |