The app can be run in a docker container.
The image can be easily built with docker build
as follows:
docker build -t reporting-hub-bop-trx-ui:local .
You can run the app container as follows:
docker run -p 8082:8082 reporting-hub-bop-trx-ui:local
You can pass the environment variable REACT_APP_API_BASE_URL
if you want to use a static api base url in your application.
The frontend production build can include the version and commit hash the build uses. The env variables responsible to add these values to the bundle are:
REACT_APP_VERSION
the package.json versionREACT_APP_COMMIT
the current commit hash
docker build \
--build-arg REACT_APP_NAME=`npm run name --silent` \
--build-arg REACT_APP_VERSION=`npm run version --silent` \
--build-arg REACT_APP_COMMIT=`git rev-parse HEAD`\
-t reporting-hub-bop-trx-ui \
.
The application loads the configuration file config.json
at bootstrap in order to determine what are the api and auth endpoints.
The config.json
is produced at runtime, it uses environment variables passed to docker.
docker run --rm \
-p 8082:8082 \
-e REACT_APP_API_BASE_URL="https://your-api-base-url" \
-e REACT_APP_MOCK_API="true" \
reporting-hub-bop-trx-ui