Python Web Application Deployment Tutorial - Using Docker & Docker Compose - Part 1

#Flask #Docker #DockerCompose #Python
Welcome to a new series about Flask and Docker combined! In this video, you will learn the best practices to deploy your Web application do production, using the best deployment tools like Docker and Docker Compose, and more!

First time using Docker? Consider watching my getting started 40-minute tutorial that will clarify a lot for you:

👍 Subscribe for more Tutorials like this!
🔥 Comment below on other topics you want to see tutorials next on my Channel.

My website:​

🎥 My YouTube Gear 🎥
Camera (Canon EOS 250D) :
Microphone (Rode NT-Mini) :
Headphones (JBL LIVE 500BT) :
Tripod (Neewer Portable Tripod) :
Desklight(AUKEY Cordless Lamp):
Keyboard ( Razer Blackwidow Green Switch ) :
Mouse ( Razer LanceHead ) :
Lights ( Neewer 2-Pack Dimmable ):

Useful Links:
Docker Official Documentation –
Chocolatey Installation: (will help you to automate installation on your windows machine)
Docker Hub (All the official Images) –

GitHub Repository with the code of the project: (Scroll down to the 16th folder)

The app we will deploy to production – 00:00 – 02:55
Dependencies of our app (requirements.txt) 02:56 – 05:28
Creating the Dockerfile and organizing configurations – 05:29 – 13:31
Building and running Flask container – 13:32 – 17:36
Configuring Database configurations – 17:37 – 26:39
Testing the application with DEBUG on&off – 26:40 – 31:25


16 thoughts on “Python Web Application Deployment Tutorial – Using Docker & Docker Compose – Part 1”
  1. I am getting the following error while building the docker image : => ERROR [5/6] RUN pip3 install -r requirements.txt 4.1s
    > [5/6] RUN pip3 install -r requirements.txt:
    #10 3.464 Collecting flask
    #10 3.581 Downloading Flask-2.1.2-py3-none-any.whl (95 kB)
    #10 3.642 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95.2/95.2 KB 2.3 MB/s eta 0:00:00
    #10 3.714 ERROR: Could not find a version that satisfies the requirement flask-sqlalachemy (from versions: none)
    #10 3.716 ERROR: No matching distribution found for flask-sqlalachemy
    #10 3.939 WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
    #10 3.939 You should consider upgrading via the '/usr/local/bin/python -m pip install –upgrade pip' command.

  2. thanks for the awesome explanation, for the last part of the video, I try to enter the right credentials admin/admin, but also the connection was failed .can you explain why, please

  3. I'm not able to run on localhost using docker compose. How to do ? here's my yaml file

    version: '3.3' # version of compose format



    build: ./landing # path is relative to docker-compose.yml location

    hostname: landing-service


    – "5001:5000" # host:container




    – landing-service

    # Add more services below



  4. This is the "best practices" python docker video I've dreamed about. Good work man, the amount/quality of content you have up is truly impressive.

  5. just came from the flask tutorial on the freecodecamp…..awesome work ..hope to see more videos from you

  6. This is a great tutorial. Is there any reason, inside the Dockerfile, you copy requirements.txt into /code/ directory in one step and then copy the remaining files in another step? Why not copy all at once?

Leave a Reply

Your email address will not be published.

Captcha loading...