Created
November 17, 2015 15:46
-
-
Save edwinallenz/2f699333f4e9e053173a to your computer and use it in GitHub Desktop.
Docker volume test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| from redis import Redis | |
| import os | |
| app = Flask(__name__) | |
| redis = Redis(host='redis', port=6379) | |
| @app.route('/') | |
| def hello(): | |
| redis.incr('hits') | |
| return 'Hello World! I have been seen %s times.' % redis.get('hits') | |
| if __name__ == "__main__": | |
| app.run(host="0.0.0.0", debug=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| web: | |
| build: . | |
| command: python app.py | |
| ports: | |
| - "5000:5000" | |
| volumes: | |
| - .:/code | |
| links: | |
| - redis | |
| redis: | |
| image: redis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:2.7 | |
| ADD . /code | |
| WORKDIR /code | |
| RUN pip install -r requirements.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| flask | |
| redis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment