aquariumbio / aquarium

The Aquarium Lab Operating System
http://klavinslab.org/aquaverse/
MIT License
57 stars 15 forks source link

Change frontend parameterization to support production container (16pts) #648

Open bjkeller opened 3 years ago

bjkeller commented 3 years ago

The frontend is parameterized with environment variables REACT_APP_BACKEND and REACT_APP_BACKEND_PORT in frontend/src/helpers/api/axiosInstance.js to support different configurations for different environments. This works fine for Docker container parameterization in test and development environments, but when building a production image that uses a static server webpack instantiates the variables and eliminates the parameterization.

The goal of this issue is to change to a parameterization of frontend that allows a production image to be built using react build and still allows for the environment variables.

The best strategy seems to be to create a config file that the code uses, but is not mangled by webpack. This post describes the approach: https://developers.redhat.com/blog/2021/03/04/making-environment-variables-accessible-in-front-end-containers/

Resolution of this issue will change the parameterization so that frontend still works in development and test.