1
0
Fork 0
mirror of https://github.com/docker/awesome-compose.git synced 2025-04-26 02:38:07 +02:00

Added Flask/Redis

Signed-off-by: ajeetraina <ajeetraina@gmail.com>
This commit is contained in:
ajeetraina 2022-03-07 11:45:07 +05:30
parent 99d423e7dd
commit 6d2816541c
17 changed files with 36 additions and 85 deletions

15
flask-redis/app.py Normal file
View file

@ -0,0 +1,15 @@
# compose_flask/app.py
from flask import Flask
from redis import Redis
app = Flask(__name__)
redis = Redis(host='redis', port=6379)
@app.route('/')
def hello():
redis.incr('hits')
return 'This webpage has been viewed %s time(s).' % redis.get('hits')
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)