Problem

I wanted to figure out when I should use certain API technologies, specifically:

Solution

I searched the web and read a handful of “versus” articles & “getting started” tutorials and wanted to capture my naive and over-simplistic decision process/tree here, just in case I forget what I had learned in the future.

I have not tried all of these different technologies so I cannot say for certain, but the following would be my “80/20 rule”/”rule-of-thumb” guideline, should a project present a need to…


Problem

For whichever technology I am trying to learn, I always try to gauge where the 80/20 mark is. I want to spend the least amount of effort (~20%) and gain the most amount of value (~80%). This is a rough idea and I might not always hit it exactly, maybe because project requirements forces me to learn more or if I just happen to be find something super interesting. However, if I am able to land close to the 80/20 mark, then I should be able to spend the extra time and pick up the the remaining concepts if needed…


This article just lists some general coding philosophies that has guided me in how I design and write my code.

Source Code Answer “What” and “How”

The application source code answers what the code is doing.

  • Diving a bit deeper in to self-documenting source code, the class, variable, and method/function names answer what the code is doing. The actual code inside the class and method/function answers how the code is doing what its name suggests.
  • Analogously, I use class, file and function/method names like chapter titles. The main function is like a table of contents with these chapter titles. …

Problem

You want to use PostgreSQL and avoid manually installing the database by using Docker-Compose.

Solution

This tutorial goes through using Docker-Compose to install and use the PostgreSQL database.

Using Docker-Compose has these benefits:

  • it can be faster, repeatable, and automatic
  • it saves you from installing the database directly on your host machine
  • it allows you to have multiple different versions of the database, in case each of your projects require you to use different versions

These are the steps we will take for this tutorial:

  1. configure docker-compose to use the postgresql container
  2. log in to the postgresql container
  3. create a table


Problem

You want to see an example of a Django project that runs inside containers.

Solution

This tutorial goes through one example Django project that runs inside containers.

Front Matter

The code for this example containerized Django application can be found here:

This article will explain the code that:

  1. Bootstraps the application
  2. Starts up the application
  3. Listens for your browser request
  4. Fetches a List of Greetings
  5. Creates a New Greeting
  6. Updates a Greeting
  7. Deletes a Greeting
  8. Seeds the initial data
  9. Runs a task to administer the application
  10. Tests the application
  11. Documents the Greetings Resource
  12. Lints the application

If you want to see the steps…


Problem

You want to start a Django project that runs inside containers, but are not sure how to take that first step.

Solution

This article will go through starting a new containerized Django application. It consists of these high level steps:

  1. Set up a Python environment inside a container
  2. Use the Django library to scaffold a new project
  3. Bring Up the Vanilla Application
  4. Create the application’s first resource

At the end of this tutorial, your application will look like this:

Application Screenshot

If you want to take a deeper dive into the end state of the code that makes this application work (rather than…


Problem

You want to learn how to use docker-compose but are not sure how to go about learning it. To further compound the issue, understanding containers is not trivial.

Solution

These tutorials might help you understand docker-compose by going through how you might use docker-compose (and hence containers) to build a web application service.

Downloading Images

Running Images

Building Images

The above tutorials will get you pretty far with containers. The following tutorials will go through nuances of using containers that will complete a typical development workflow.

Working with Files and Containers

Working with Networked Services and Containers

Working with Docker-Compose Run vs Up vs Exec

Notes

Using docker-compose makes it easy to orchestrate multiple containers to provide a system of services. Everything done in this tutorial using…


cc:https://www.flickr.com/photos/appleboy/22947137613

Problem

Before you can use any Docker container, you first need to download a Docker image on to your local development machine.

Solution

This tutorial will go through how to download a Docker image from Docker Hub on to your local development machine and then understand what happened.

Here are the steps we will take:

  1. declare which Docker image we want to download in a docker-compose.yml file
  2. download the Docker image using docker-compose.yml

This diagram shows what is happening behind the scenes:

Docker-Compose Pull

Front Matter

This tutorial assumes you’ve installed docker and docker-compose. …


Problem

Now that we have downloaded an image on to our local development machine (aka host). What can we do with this image?

Solution

One possible option we have is to run a container based on this image.

This tutorial will go through running a Docker image from Docker Hub and then understand what happened.

Here are the steps we will take:

  1. reuse our existing docker-compose.yml file in conjunction with docker-compose up command
  2. modify the docker-compose.yml so that we can reach the service running inside the container from our host

This diagram shows what is happening behind the scenes:

Docker-Compose Up

Front Matter

This…


Problem

When we were downloading images and then running the image as a container, we were using images that others have provided via Docker Hub. How do we create a Docker image that is customized for our own use?

Solution

To create a custom image that meets our own requirements, we will need to build an image that contains what we need.

This tutorial will go through building a Docker image and then explaining what happened.

Here are the steps we will take:

  1. update our existing docker-compose.yml file so that it builds a custom image
  2. add instructions to a Dockerfile that Docker…

Zhao Li

“In case it helps others…” Please suggest technologies for future tutorial articles at https://gitlab.com/zhao-li/tutorial-articles

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store