kids-first / kf-ui-fhir-data-dashboard

💡📊 Prototype FHIR data dashboard - what's in my FHIR server?
Apache License 2.0
7 stars 2 forks source link

Add runtime env variables for production deployment #82

Closed znatty22 closed 4 years ago

znatty22 commented 4 years ago

Initialization variables (REACT_APP_FHIR_API, REACT_APP_AUTH_TYPE, etc) control which FHIR server the dashboard initially points and asks the user to auth with. When using the Node.js server locally to serve the app, these can be read in as environment variables and supplied to the app at runtime.

However prd deployment, the app must first be built into a static site which means these variables are baked into the static files. We need these variables to change depending on the target environment (dev, qa, prd) the app is being deployed to.

We need to modify the Docker image entrypoint to read these environment variables and write them to a module which can be used by the app at runtime. Then we need to create env files with these env vars and upload them to S3 secrets buckets. The deploy pipeline will read the files, export the env vars in the container which wraps the app container and then call the app container's entrypoint.