docker-nginx-react icon indicating copy to clipboard operation
docker-nginx-react copied to clipboard

replace %env% in html file while nginx start

Open zzswang opened this issue 5 years ago • 1 comments

Create React APP could inject env into html at build-time. We try to make it injecting at run-time.

like envsubst, we need to replace %env% word in html file with correct env value.

input

<title>%REACT_APP_TITLE%</title>

output

<title>Some Real Title in Docker Env</title>

if env REACT_APP_TITLE not exist, leave <title>%REACT_APP_TITLE%</title> there, don't change.

zzswang avatar Feb 28 '20 07:02 zzswang

need to edit start-nginx.sh file

zzswang avatar Feb 28 '20 07:02 zzswang