In this tutorial, you'll see Create a Running Docker Container with Gunicorn and Flask. The simplest container setup imaginable. Start here
Let’s begin by creating a minimal Flask application:
from flask import Flask app = Flask(__name__) @app.route('/') @app.route('/index') def index(): return 'Hello world!'
Next, let’s write the command that will run the Gunicorn server:
#!/bin/sh gunicorn --chdir app main:app -w 2 --threads 2 -b 0.0.0.0:8000
The parameters are pretty much self-explanatory: We are telling Gunicorn that we want to spawn two worker processes running two threads each. We are also accepting connections from the outside and overriding Gunicorn’s default port (8000).
Our original Kubernetes tool list was so popular that we've curated another great list of tools to help you improve your functionality with the platform.
Get Hands-on experience on Kubernetes and the best comparison of Kubernetes over the DevOps at your place at Kubernetes training
In this tutorial, you’re going to learn a variety of Python tricks that you can use to write your Python code in a more readable and efficient way like a pro.
Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub.
Today you're going to learn how to use Python programming in a way that can ultimately save a lot of space on your drive by removing all the duplicates. We gonna use Python OS remove( ) method to remove the duplicates on our drive. Well, that's simple you just call remove ( ) with a parameter of the name of the file you wanna remove done.