Christa  Stehr

Christa Stehr

1620100157

Dockerizing FastAPI with Postgres, Uvicorn, and Traefik

In this tutorial, we look at how to set up FastAPI with Postgres, Uvicorn, and Docker. For production environments, we’ll add on Gunicorn, Traefik, and Let’s Encrypt.

#fastapi #python #postgres #docker

What is GEEK

Buddha Community

Dockerizing FastAPI with Postgres, Uvicorn, and Traefik
Christa  Stehr

Christa Stehr

1620100157

Dockerizing FastAPI with Postgres, Uvicorn, and Traefik

In this tutorial, we look at how to set up FastAPI with Postgres, Uvicorn, and Docker. For production environments, we’ll add on Gunicorn, Traefik, and Let’s Encrypt.

#fastapi #python #postgres #docker

Iliana  Welch

Iliana Welch

1595249460

Docker Explained: Docker Architecture | Docker Registries

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

In this video lesson you will learn:

  • What is Docker Host
  • What is Docker Engine
  • Learn about Docker Architecture
  • Learn about Docker client and Docker Daemon
  • Docker Hub and Registries
  • Simple demo to understand using images from registries

#docker #docker hub #docker host #docker engine #docker architecture #api

Docker Architecture Overview & Docker Components [For Beginners]

If you have recently come across the world of containers, it’s probably not a bad idea to understand the underlying elements that work together to offer containerisation benefits. But before that, there’s a question that you may ask. What problem do containers solve?

After building an application in a typical development lifecycle, the developer sends it to the tester for testing purposes. However, since the development and testing environments are different, the code fails to work.

Now, predominantly, there are two solutions to this – either you use a Virtual Machine or a containerised environment such as Docker. In the good old times, organisations used to deploy VMs for running multiple applications.

So, why did they started adopting containerisation over VMs? In this article, we will provide detailed explanations of all such questions.

#docker containers #docker engine #docker #docker architecture

Turner  Crona

Turner Crona

1595822100

Dockerizing Masonite with Postgres, Gunicorn, and Nginx

This is a step-by-step tutorial that details how to configure Masonite to run on Docker with Postgres. For production environments, we’ll add on Nginx and Gunicorn. We’ll also take a look at how to serve static and user-uploaded media files via Nginx.

Masonite is a modern, developer centric, batteries included Python web framework. If you’re new to the framework check out the 5 reasons why people are choosing Masonite over Django blog post.

Dependencies:

  1. Masonite v2.2
  2. Docker v19.03.5
  3. Python v3.8.0

Project Setup

Create a project directory, install the Masonite CLI (craft), and create a new Masonite project:

$ mkdir masonie-on-docker && cd masonie-on-docker
$ python3.8 -m venv env
$ source env/bin/activate
(env)$ pip install masonite-cli==2.2.2
(env)$ craft new web
(env)$ cd web
(env)$ craft install
(env)$ craft serve

Feel free to swap out virtualenv and Pip for Pipenv if that’s your tool of choice.

Navigate to >http://localhost:8000/ to view the Masonite welcome screen. Kill the server and exit from the virtual environment once done. We now have a simple Masonite project to work with.

Next, before adding Docker, let’s clean up the project structure a bit.

Remove the following files from the “web” directory:

  • .env-example
  • .gitignore
  • .travis.yml

Move the .env file to the project folder and rename it to .env.dev.

Your project structure should look like:

#dockerizing #postgres #gunicorn #nginx #docker #masonite

Docker manifest - A peek into image's manifest.json files

docker manifest – An experimental feature !

The image manifest provides a configuration and a set of layers for a container image.

This is an experimental feature. To enable this feature in the Docker CLI, one can edit the config.json file found in ~/.docker/config.json like :

{
        "auths": {
                "https://index.docker.io/v1/": {
                        "auth": "XXXXXXX"
                }
        },
        "HttpHeaders": {
                "User-Agent": "Docker-Client/19.03.8 (linux)"
        },
        "experimental": "enabled",
        "debug": true
}

What is ‘docker manifest’ ?

The docker manifest command does not work independently to perform any action. In order to work with the docker manifest or manifest list, we use sub-commands along with it. This manifest sub-command can enable us to interact with the image manifests. Furthermore, it also gives information about the OS and the architecture, that a particular image was built for.

A single manifest comprises of information about an image, it’s size, the layers and digest.

A manifest list is a list of image layers (manifests) that are, created by specifying one or more image names. It can then be used in the same way as an image name in docker pull and docker run commands.

Commands to get started with :

After enabling this feature, one would be able to access the following command :

docker-manifest-enter image description here

These commands are easy to use. It basically avoids the need for pulling and running and then testing the images locally, from a docker registry.

Next, to inspect an image manifest, follow this syntax,

 docker manifest inspect image-name

enter image description here

.

#devops #docker #devops #docker #docker learning #docker-image