-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deperecate use of process.env, add healthcheck
- Update references to use window.env - add default env.js file to public - Clean up various comments about config - update URLs to use beehive defaults for dev - update docker build to use static config - update github workflow to build to static directory and use that to build dockerfile
- Loading branch information
Showing
23 changed files
with
70 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
.git | ||
.idea | ||
build | ||
|
||
**/*.env* |
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 |
---|---|---|
@@ -1 +1 @@ | ||
PUBLIC_URL=http://localhost:3333/ | ||
PUBLIC_URL=./ |
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 |
---|---|---|
@@ -1,39 +1,16 @@ | ||
# This Dockerfile adapted from https://mherman.org/blog/dockerizing-a-react-app/ | ||
# and Client Explorer Dockerfile. | ||
|
||
# This Dockerfile can (and should) be used to pass through automatically generated | ||
# version information to the build which is triggered when the image is run. | ||
# To do this, issue the following build command: | ||
# | ||
# docker build --build-arg REACT_APP_APP_VERSION="$(./generate-commitish.sh)" -t <tag> . | ||
|
||
# At this moment, Node.js 10.16 LTS is recommended for most users. | ||
# | ||
# In future, as we scale up, we may want to use an Alpine base image, which would reduce | ||
# the size of the image by about an order of magnitude and reduce the attack surface of | ||
# the image as well. | ||
FROM node:22 | ||
|
||
FROM node:16 | ||
RUN npm install -g serve | ||
|
||
ADD . /app | ||
ADD build /app | ||
ADD docker/entrypoint.sh /app/docker/entrypoint.sh | ||
WORKDIR /app | ||
RUN chown node /app | ||
|
||
ENV PATH /app/node_modules/.bin:$PATH | ||
COPY --chown=node:node package.json /app/package.json | ||
|
||
# Currently, we have to force install. For details, see ./docs/installation.md | ||
RUN npm install --quiet --force | ||
RUN npm install -g serve | ||
COPY --chown=node:node . /app | ||
|
||
USER node | ||
EXPOSE 8080 | ||
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "-f", "http://localhost:8080/healthcheck.js" ] | ||
|
||
# Move the build arg REACT_APP_APP_VERSION into an | ||
# environment variable of the same name, for consumption | ||
# by the npm build process in ./entrypoint.sh | ||
ARG REACT_APP_APP_VERSION | ||
ENV REACT_APP_APP_VERSION $REACT_APP_APP_VERSION | ||
|
||
USER node | ||
ENTRYPOINT docker/entrypoint.sh | ||
ENTRYPOINT ["docker/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
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
window.env = { | ||
PUBLIC_URL: "http://localhost:30502/", | ||
REACT_APP_BC_BASE_MAP_TILES_URL: | ||
"https://services.pacificclimate.org/tiles/bc-albers-lite/{z}/{x}/{y}.png", | ||
}; |
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 |
---|---|---|
@@ -1,8 +1,3 @@ | ||
# We build the app as part of the container startup so that the build process | ||
# can consume the runtime environment variables. (CRA apps can only access | ||
# environment variables at build time, not at run time.) This makes starting a | ||
# container a lot heavier, but we don't spin up many instances, or often, | ||
# so it doesn't matter. | ||
#!/bin/bash | ||
|
||
npm run build | ||
serve -s build -l 8080 | ||
serve -s . -l 8080 |
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 was deleted.
Oops, something went wrong.
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,7 @@ | ||
// Example environment config for a YNWT based deployment | ||
|
||
window.env = { | ||
PUBLIC_URL: "http://localhost:30502/", | ||
REACT_APP_YNWT_BASE_MAP_TILES_URL: | ||
"https://services.pacificclimate.org/tiles/yukon-albers-lite/{z}/{x}/{y}.png", | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
"lethargy": "^1.0.9", | ||
"lodash": "^4.17.21", | ||
"memoize-one": "^6.0.0", | ||
"pcic-react-leaflet-components": "git+https://[email protected]/pacificclimate/pcic-react-leaflet-components.git#3.0.1", | ||
"pcic-react-leaflet-components": "git+https://[email protected]/pacificclimate/pcic-react-leaflet-components.git#tile-url-as-prop", | ||
"plotly.js-basic-dist": "^2.29.0", | ||
"prop-types": "^15.8.1", | ||
"react": "^18.2.0", | ||
|
@@ -61,7 +61,7 @@ | |
}, | ||
"scripts": { | ||
"start": "craco start", | ||
"build": "craco build", | ||
"build": "REACT_APP_APP_VERSION=$(bash ./generate-commitish.sh) && craco build", | ||
"test": "craco test --env=jsdom", | ||
"eject": "react-scripts eject", | ||
"reinstall": "rm -rf ./node_modules; npm install --dev", | ||
|
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,7 @@ | ||
window.env = { | ||
PUBLIC_URL: "http://localhost:30502", | ||
REACT_APP_BC_BASE_MAP_TILES_URL: | ||
"https://swarm.pacificclimate.org/tiles/bc-albers-lite/{z}/{x}/{y}.png", | ||
REACT_APP_YNWT_BASE_MAP_TILES_URL: | ||
"https://swarm.pacificclimate.org/tiles/yukon-albers-lite/{z}/{x}/{y}.png", | ||
}; |
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 @@ | ||
// app is serving |
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
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