Skip to content

Commit

Permalink
chore: fix runtime vars
Browse files Browse the repository at this point in the history
  • Loading branch information
farhanangullia committed Oct 9, 2023
1 parent cb0a74a commit 31b7e1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
11 changes: 0 additions & 11 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion apps/chaos-playground-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD sed -i '/\/\*ENV_BEGIN\*\/`/r '<(env | grep --color=never "^REACT_APP_") /usr/share/nginx/html; nginx '-g daemon off;'
CMD sed -i "s|PLACEHOLDER|$(env | grep --color=never '^REACT_APP_' | tr '\n' ',')|" /usr/share/nginx/html/index.html; nginx '-g daemon off;'
5 changes: 2 additions & 3 deletions apps/chaos-playground-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
<title>Chaos Playground</title>
<script>
window.env = {};
/*ENV_BEGIN*/`
`/*ENV_END*/
.split('\n')
/*ENV_BEGIN*/`PLACEHOLDER`/*ENV_END*/
.split(',')
.map((kv) => kv.split('='))
.forEach(([key, value]) => {
window.env[key] = value;
Expand Down

0 comments on commit 31b7e1d

Please sign in to comment.