Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1.  
  2.  
  3. app.py
  4.  
  5. # app.py - a minimal flask api using flask_restful
  6. from flask import Flask
  7. from flask_restful import Resource, Api
  8.  
  9. app = Flask(__name__)
  10. api = Api(app)
  11.  
  12. class HelloWorld(Resource):
  13. def get(self):
  14. return {'hello': 'world'}
  15.  
  16. api.add_resource(HelloWorld, '/')
  17.  
  18. if __name__ == '__main__':
  19. app.run(debug=True, host='0.0.0.0')
  20.  
  21.  
  22. requirements.txt
  23.  
  24. flask
  25. flask_restful
  26.  
  27.  
  28. Dockerfile
  29.  
  30. # Dockerfile - this is a comment. Delete me if you want.
  31. FROM python:2.7
  32. COPY . /app
  33. WORKDIR /app
  34. RUN pip install -r requirements.txt
  35. ENTRYPOINT ["python"]
  36. CMD ["app.py"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement