mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-08-01 23:34:18 -07:00
dockerize front-end and pass env vars to npm build (#614)
* Revert "dockerize front end (#558)"
This reverts commit 89c23faf7a
.
* dockerize frontend
- adds score server and website docker compose
- creates docker ignore
- adds .env.* for dev, prod and local
- adds dockerfile for website
- adds env to gatsby-config
- adds hostaddress to develop / start script
- adds istructions in README for running docker
- replaces fixed URLS with ones based on env vars
- creates a score server dockerfile
* updates README to change map tiles source
* adds env DATA_SOURCE:development to deploy GHA
* capitalize readme
This commit is contained in:
parent
b3f63c29f6
commit
704831159f
12 changed files with 126 additions and 30 deletions
|
@ -2,22 +2,21 @@ import {LngLatBoundsLike} from 'maplibre-gl';
|
|||
import {isMobile as isMobileReactDeviceDetect} from 'react-device-detect';
|
||||
import {defineMessages} from 'react-intl';
|
||||
|
||||
// URLS
|
||||
export const DOWNLOAD_ZIP_URL = 'https://justice40-data.s3.amazonaws.com/data-pipeline/data/score/downloadable/Screening+Tool+Data.zip';
|
||||
export const DOWNLOAD_ZIP_URL = [
|
||||
process.env.GATSBY_DATA_ROOT_PATH,
|
||||
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH,
|
||||
process.env.GATSBY_SCORE_DOWNLOAD_FILE_PATH,
|
||||
].join('/');
|
||||
|
||||
// This is the URL for the origin S3 bucket:
|
||||
// export const ORIGIN_BASE_URL = 'https://justice40-data.s3.amazonaws.com';
|
||||
|
||||
// This is the URL for the CDN that delivers the tile data
|
||||
export const FEATURE_TILE_BASE_URL = 'https://d3jqyw10j8e7p9.cloudfront.net';
|
||||
const FEATURE_TILE_PATH = 'data-pipeline/data/score/tiles';
|
||||
|
||||
// This is the URL for the CDN that delivers the application
|
||||
// const APP_BASE_URL = 'https://d2zjid6n5ja2pt.cloudfront.net';
|
||||
const XYZ_SUFFIX = '{z}/{x}/{y}.pbf';
|
||||
|
||||
export const featureURLForTilesetName = (tilesetName :string ) : string => {
|
||||
return `${FEATURE_TILE_BASE_URL}/${FEATURE_TILE_PATH}/${tilesetName}/${XYZ_SUFFIX}`;
|
||||
return [
|
||||
process.env.GATSBY_DATA_ROOT_PATH,
|
||||
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH,
|
||||
process.env.GATSBY_MAP_TILES_PATH,
|
||||
tilesetName,
|
||||
XYZ_SUFFIX,
|
||||
].join('/');
|
||||
};
|
||||
export const FEATURE_TILE_HIGH_ZOOM_URL = featureURLForTilesetName('high');
|
||||
export const FEATURE_TILE_LOW_ZOOM_URL = featureURLForTilesetName('low');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue