diff --git a/.netlify/build-deploy-preview.sh b/.netlify/build-deploy-preview.sh index cbb51c376..b088f9d46 100644 --- a/.netlify/build-deploy-preview.sh +++ b/.netlify/build-deploy-preview.sh @@ -27,4 +27,4 @@ mv platform/viewer/dist/* .netlify/www/pwa -v echo 'Nothing left to see here. Go home, folks.' # Build using react-scripts -# npx cross-env PUBLIC_URL=/demo REACT_APP_CONFIG=config/netlify.js react-scripts --max_old_space_size=4096 build +# npx cross-env PUBLIC_URL=/demo APP_CONFIG=config/netlify.js react-scripts --max_old_space_size=4096 build diff --git a/docs/latest/connecting-to-image-archives/google-cloud-healthcare.md b/docs/latest/connecting-to-image-archives/google-cloud-healthcare.md index 6521dae49..dc36b8e1d 100644 --- a/docs/latest/connecting-to-image-archives/google-cloud-healthcare.md +++ b/docs/latest/connecting-to-image-archives/google-cloud-healthcare.md @@ -53,7 +53,7 @@ Images can even be transcoded on the fly if this is desired. ```bash cd OHIFViewer yarn install -REACT_APP_CONFIG=config/google.js yarn run dev +APP_CONFIG=config/google.js yarn run dev ``` ## Running via Docker diff --git a/docs/latest/deployment/recipes/build-for-production.md b/docs/latest/deployment/recipes/build-for-production.md index 3265c158d..e7c5ddf11 100644 --- a/docs/latest/deployment/recipes/build-for-production.md +++ b/docs/latest/deployment/recipes/build-for-production.md @@ -72,9 +72,9 @@ how to configure the project for your own imaging archive below. The configuration for our project is in the `/public/config` directory. Our build process knows which configuration file to use based on the -`REACT_APP_CONFIG` environment variable. By default, its value is +`APP_CONFIG` environment variable. By default, its value is [`default.js`](https://github.com/OHIF/Viewers/blob/react/public/config/default.js). -When we build, the `%REACT_APP_CONFIG%` value in +When we build, the `%APP_CONFIG%` value in our[`/public/index.html`](https://github.com/OHIF/Viewers/blob/react/public/index.html#L12-L15) file is substituted for the correct configuration file's name. This sets the`window.config` equal to our configuration file's value. @@ -108,13 +108,13 @@ window.config = { ``` You can also create a new config file and specify its path relative to the build -output's root by setting the `REACT_APP_CONFIG` environment variable. You can +output's root by setting the `APP_CONFIG` environment variable. You can set the value of this environment variable a few different ways: - [Add a temporary environment variable in your shell](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-temporary-environment-variables-in-your-shell) - [Add environment specific variables in `.env` file(s)](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env) - Using the `cross-env` package in an npm script: - - `"build": "cross-env REACT_APP_CONFIG=config/my-config.js react-scripts build"` + - `"build": "cross-env APP_CONFIG=config/my-config.js react-scripts build"` After updating the configuration, `yarn run build:web` to generate updated build output. diff --git a/docs/latest/deployment/recipes/nginx--image-archive.md b/docs/latest/deployment/recipes/nginx--image-archive.md index 6a3da8b0a..e2db51699 100644 --- a/docs/latest/deployment/recipes/nginx--image-archive.md +++ b/docs/latest/deployment/recipes/nginx--image-archive.md @@ -124,10 +124,10 @@ likely want to update: The OHIF Viewer's configuration is imported from a static `.js` file and made available globally at `window.config`. The configuration we use is set to a specific file when we build the viewer, and determined by the env variable: -`REACT_APP_CONFIG`. You can see where we set its value in the `dockerfile` for +`APP_CONFIG`. You can see where we set its value in the `dockerfile` for this solution: -`ENV REACT_APP_CONFIG=config/docker_openresty-orthanc.js` +`ENV APP_CONFIG=config/docker_openresty-orthanc.js` You can find the configuration we're using here: `/public/config/docker_openresty-orthanc.js` diff --git a/docs/latest/deployment/recipes/user-account-control.md b/docs/latest/deployment/recipes/user-account-control.md index d22648a60..f6bb667e9 100644 --- a/docs/latest/deployment/recipes/user-account-control.md +++ b/docs/latest/deployment/recipes/user-account-control.md @@ -125,10 +125,10 @@ likely want to update: The OHIF Viewer's configuration is imported from a static `.js` file and made available globally at `window.config`. The configuration we use is set to a specific file when we build the viewer, and determined by the env variable: -`REACT_APP_CONFIG`. You can see where we set its value in the `dockerfile` for +`APP_CONFIG`. You can see where we set its value in the `dockerfile` for this solution: -`ENV REACT_APP_CONFIG=config/docker_openresty-orthanc-keycloak.js` +`ENV APP_CONFIG=config/docker_openresty-orthanc-keycloak.js` You can find the configuration we're using here: `/public/config/docker_openresty-orthanc-keycloak.js` diff --git a/docs/latest/essentials/configuration.md b/docs/latest/essentials/configuration.md index cd87a9ba3..190785d2b 100644 --- a/docs/latest/essentials/configuration.md +++ b/docs/latest/essentials/configuration.md @@ -8,9 +8,9 @@ The configuration for our project is in the `/public/config` directory. Our build process knows which configuration file to use based on the -`REACT_APP_CONFIG` environment variable. By default, its value is +`APP_CONFIG` environment variable. By default, its value is [`default.js`](https://github.com/OHIF/Viewers/blob/react/public/config/default.js). -When we build, the `%REACT_APP_CONFIG%` value in +When we build, the `%APP_CONFIG%` value in our[`/public/index.html`](https://github.com/OHIF/Viewers/blob/react/public/index.html#L12-L15) file is substituted for the correct configuration file's name. This sets the `window.config` equal to our configuration file's value. @@ -44,13 +44,13 @@ window.config = { ``` You can also create a new config file and specify its path relative to the build -output's root by setting the `REACT_APP_CONFIG` environment variable. You can +output's root by setting the `APP_CONFIG` environment variable. You can set the value of this environment variable a few different ways: - [Add a temporary environment variable in your shell](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-temporary-environment-variables-in-your-shell) - [Add environment specific variables in `.env` file(s)](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env) - Using the `cross-env` package in an npm script: - - `"build": "cross-env REACT_APP_CONFIG=config/my-config.js react-scripts build"` + - `"build": "cross-env APP_CONFIG=config/my-config.js react-scripts build"` After updating the configuration, `yarn run build:web` to generate updated build output. diff --git a/docs/latest/essentials/data-source.md b/docs/latest/essentials/data-source.md index 2cc00c2dc..405997dcb 100644 --- a/docs/latest/essentials/data-source.md +++ b/docs/latest/essentials/data-source.md @@ -87,16 +87,16 @@ is running the `dev:orthanc` script in our project's `package.json`. That script is: ```js -cross-env PORT=5000 REACT_APP_CONFIG=config/docker_nginx-orthanc.js react-scripts start +cross-env PORT=5000 APP_CONFIG=config/docker_nginx-orthanc.js react-scripts start ``` - `cross-env` sets two environment variables - PORT: 5000 - - REACT_APP_CONFIG: `config/docker_nginx-orthanc.js` + - APP_CONFIG: `config/docker_nginx-orthanc.js` - `react-scripts` runs it's `start` script. This is [the de-facto way][cra-start] to run a "Create React App" in development mode. -The `REACT_APP_CONFIG` value tells our app which file to load on to +The `APP_CONFIG` value tells our app which file to load on to `window.config`. By default, our app uses the file at `/public/config/default.js`. Here is what that configuration looks like: diff --git a/platform/viewer/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.yml b/platform/viewer/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.yml index 5a34ff182..40b6d8efe 100644 --- a/platform/viewer/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.yml +++ b/platform/viewer/.recipes/Nginx-Dcm4che/docker-compose-dcm4che.yml @@ -69,7 +69,7 @@ services: # - orthanc environment: - NODE_ENV=production - - REACT_APP_CONFIG=config/local_dcm4chee + - APP_CONFIG=config/local_dcm4chee restart: always networks: - dcm4che_default diff --git a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/dockerfile b/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/dockerfile index 6019d6790..73090e8ae 100644 --- a/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/dockerfile +++ b/platform/viewer/.recipes/OpenResty-Orthanc-Keycloak/dockerfile @@ -28,7 +28,7 @@ FROM node:11.2.0-slim as builder RUN mkdir /usr/src/app WORKDIR /usr/src/app -ENV REACT_APP_CONFIG=config/docker_openresty-orthanc-keycloak.js +ENV APP_CONFIG=config/docker_openresty-orthanc-keycloak.js ENV PATH /usr/src/app/node_modules/.bin:$PATH COPY package.json /usr/src/app/package.json diff --git a/platform/viewer/.recipes/OpenResty-Orthanc/dockerfile b/platform/viewer/.recipes/OpenResty-Orthanc/dockerfile index 6b96885cf..1a9c8ec59 100644 --- a/platform/viewer/.recipes/OpenResty-Orthanc/dockerfile +++ b/platform/viewer/.recipes/OpenResty-Orthanc/dockerfile @@ -28,7 +28,7 @@ FROM node:11.2.0-slim as builder RUN mkdir /usr/src/app WORKDIR /usr/src/app -ENV REACT_APP_CONFIG=config/docker_openresty-orthanc.js +ENV APP_CONFIG=config/docker_openresty-orthanc.js ENV PATH /usr/src/app/node_modules/.bin:$PATH COPY package.json /usr/src/app/package.json