Coder Social home page Coder Social logo

basic-backend-app's Introduction

basic-backend-app

Screen Shot 2020-06-26 at 11 39 24

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

Consul template

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!

basic-backend-app's People

Contributors

elizhl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.