mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-25 10:18:07 +02:00
Nginx/Node/Redis and Flask/Redis Compose example (#222)
* Added Node, Nginx and Redis Project * Added Flask/Redis
This commit is contained in:
parent
05095bbe0d
commit
04f8c9ca12
15 changed files with 727 additions and 2 deletions
14
flask-redis/app.py
Normal file
14
flask-redis/app.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from flask import Flask
|
||||
from redis import Redis
|
||||
|
||||
app = Flask(__name__)
|
||||
redis = Redis(host='redis', port=6379)
|
||||
|
||||
@app.route('/')
|
||||
def hello():
|
||||
redis.incr('hits')
|
||||
counter = str(redis.get('hits'),'utf-8')
|
||||
return "This webpage has been viewed "+counter+" time(s)"
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", debug=True)
|
Loading…
Add table
Add a link
Reference in a new issue