Clone the project
Create a virtualenv then run
pip install requirements.txt
flask run
If you prrefer you can use the docker image
docker pull elizhl/basic-backend-app
docker build -t basic-backend-app:latest .
docker run -p 5000:5000 basic-backend-app
Go to http://0.0.0.0:5000
We are gonna need to install consul-template in our container and the certs to connect with consul. (/files/bin and /files/certs)
Change your Dockerfile to add a pre-start and add the variables to connect witth consul. In your pre-start script you should add the validations for yourr variables such as ssl, token and CMD_command if this need to be changed
Then got to you startProcess script and do the validations again and then execute te consul-template command, as you can see you need a template consul-template with the structure of your json file that json file will be the one who feed your toggle feature
With {{ key "path" }} consul already know you are asking for a variable in the kv store so when you run the consul-template command it goes to the template read the line and make an http call to the consul server to get the value for that key
Then your app is going to start normally
If you go inside the container you will see the json file populated with the right values.
Use that value to enable/disable your features
Done!