from flask import Flask
from redis import Redis

# https://yeasy.gitbooks.io/docker_practice/content/compose/usage.html
# docker-compose up

app = Flask(__name__)
redis = Redis(host='redis', port=6379)

@app.route('/')
def hello():
    count = redis.incr('hits')
    return 'Hello World! the page has been visisted {} times\n'.format(count)

if __name__ == "__main__":
    app.run(host="0.0.0.0", debug=True)


