You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The frontend is a statically built site. For the current offline use case, we build a Docker image that serves the site with nginx. The configuration is known in advance, and available when we build the image. When somebody runs docker-compose, the site is already fully built, and not aware of environment variables that may be set.
With the deployment through CloudFormation, not all configuration is known in advance (eg. the address of the API). We need to build the Docker image in such a way that environment variables can be used to set config.
Approach
Don't build the site in the pre-baked Docker image, instead build it when the container starts so it can pick up the env vars. To do:
add node + yarn to Docker container
include node modules in Docker image, so this doesn't have to be done when container launches
build the site when docker starts
The text was updated successfully, but these errors were encountered:
The above approach is implemented and works. The downside is that starting the container takes a long time. (1m+)
A future enhancement is to find a more elegant way to load the environment variables when the app starts. This would allow us to include a pre-built site in the Docker image and reduce launch time of the container.
The frontend is a statically built site. For the current offline use case, we build a Docker image that serves the site with nginx. The configuration is known in advance, and available when we build the image. When somebody runs
docker-compose
, the site is already fully built, and not aware of environment variables that may be set.With the deployment through CloudFormation, not all configuration is known in advance (eg. the address of the API). We need to build the Docker image in such a way that environment variables can be used to set config.
Approach
Don't build the site in the pre-baked Docker image, instead build it when the container starts so it can pick up the env vars. To do:
The text was updated successfully, but these errors were encountered: