Giter Site home page Giter Site logo

sample-python-monolith-app's Introduction

Sample python monolith application

Tech Stack

  • Flask
  • Python 3.7.16

Build Instructions

git clone [email protected]:tarunsaxenattn/sample-python-monolith-app.git
cd sample-python-monolith-app
docker build . -t sample-python-monolith-app -f docker/Dockerfile

Run App locally for monolith app for internal healthcheck

docker run -itd -e healthcheckhost=127.0.0.1 --name sample-python-monolith-app -p 80:80 sample-python-monolith-app

Run App in microservices mode for external healthcheck

docker run -itd -e healthcheckhost=<APIHOST> --name sample-python-monolith-app -p 80:80 sample-python-monolith-app

The environment variable is mandatory to pass for healthcheck to work. Intentionally this is not made default variable

APIs

GET / => UI service

curl localhost/ui
UI

GET /payment => Payment service

curl localhost/payment
Payment page

GET /login => Login service

curl localhost/login
Login page

GET /healthcheck => healthcheck service

curl localhost/healthcheck   (For 127.0.0.1)

{"hostname": "66bac320fd75", "status": "success", "timestamp": 1678819024.6349406, "results": [{"checker": "login_available", "output": "Login up @@ ", "passed": true, "timestamp": 1678819024.631133, "expires": 1678819051.631133}, {"checker": "payment_available", "output": "Payment up @@ ", "passed": true, "timestamp": 1678819024.6346788, "expires": 1678819051.6346788}]}

Run with Publically available image

Full monolith app

docker run -itd -e healthcheckhost=127.0.0.1 --name sample-python-monolith-app -p 80:80 tarunttnd/sample-python-monolith-app

Only UI app (to simulate failure and let UI healthcheck hit APIHOST URL running on different host)

docker run -itd -e healthcheckhost=<APIHOST> --name sample-python-monolith-app -p 80:80 tarunttnd/sample-python-monolith-app:ui

Destroy

docker rm -f sample-python-monolith-app

sample-python-monolith-app's People

Contributors

tarunsaxenattn 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.