Overview
This is a simple demo meant to demonstrate the process of using environment variables with Docker/React. When we build the image we pass the value of the environment variables as build arguments. You can specify as many as you need. In this example I am only using one but you can have multiple like this as well:
docker build --build-arg ARG1=test --build-arg ARG2=test .
Build and run
To build and run this example you can use the below commands.
docker build -t react-docker-test --build-arg MY_VARIABLE=world .
docker run -p 3000:3000 react-docker-test
If everything goes well, once the application has fully started you should be able to navigate to http://localhost:3000
in your browser and see the text "Hello world" on the screen.
Description
Languages
JavaScript
39.7%
HTML
36.5%
CSS
19.1%
Dockerfile
4.7%