koseburak / react-runtime-envar

This project is an example of how to dynamically manage variables in a React application using environment variables without rebuild for multiple target environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-runtime-envar

Set the runtime variables of React apps using environment variables

Build the docker image and run container

Build the docker image;

docker build -f .devops/Dockerfile -t react/runtime-envars .

Run the container using DEV envars(default);

docker run -d -p 3001:80 --name react-dev -t react/runtime-envars

Run the container using STG envars;

docker run -d -p 3002:80 --name react-stg -e DOC_TITLE=STG -e API_URL=https://stg.api.com -t react/runtime-envars

Run the container using PRD envars(default);

docker run -d -p 3003:80 --name react-prd -e DOC_TITLE=PRD -e API_URL=https://prd.api.com -t react/runtime-envars

About

This project is an example of how to dynamically manage variables in a React application using environment variables without rebuild for multiple target environment


Languages

Language:JavaScript 34.3%Language:HTML 32.1%Language:CSS 16.8%Language:Dockerfile 12.0%Language:Shell 4.8%