Tip #1 - To make flask API multithreaded, Add the option threaded in app.run()
Tip #2 - To run a flask API in Docker, which involves file operations we can specify VOLUME
VOLUME inside docker file definition - Basically with VOLUME command you get performance without externally mounting any volumes.
Tip #3 - Alternate option to #2 - Provide volume while running docker
Tip #4. Specify Volume - emptyDir inside Kubernetes for temporary data
Use emptyDir Option. emptyDir volume should NOT be used for persisting data. Data erased when pod is removed.
Happy Learning!!!
app.run(host= '0.0.0.0',port=4321,threaded=True)
Tip #2 - To run a flask API in Docker, which involves file operations we can specify VOLUME
VOLUME inside docker file definition - Basically with VOLUME command you get performance without externally mounting any volumes.
VOLUME ['/datadir']
Some good example use cases:- logs
- temp folders
Tip #3 - Alternate option to #2 - Provide volume while running docker
docker run -p 8080:8080 Demo-App --volume=/Users/tmp:/app Demo-App
Tip #4. Specify Volume - emptyDir inside Kubernetes for temporary data
Use emptyDir Option. emptyDir volume should NOT be used for persisting data. Data erased when pod is removed.
Happy Learning!!!
No comments:
Post a Comment