2 ms·
Was looking at doing something similar but settled on a slightly different approach: 1. Bundle the app image with a “container.json.template” 2. Have the UI r
by jwdunne 5y ago
Was looking at doing something similar but settled on a slightly different approach:
1. Bundle the app image with a “container.json.template”
2. Have the UI request this file first, along with a preload in the head
3. Use Nginx envsubst to populate the config.json from env vars on container start
It’s an additional HTTP request and templating JSON via string interpolation isn’t fun but it was quite simple and kept the build clean with config injected at run time.
Given the interpolation problem (I.e chaos when someone uses a number value and it’s undefined), I’d probably ditch env subst and perhaps do something else to build the JSON.