Docker

This design describes docker installations in NSCHOOL, and includes the following topics:

  • Server design
  • Directory organisation
  • Containers
    • Composer files
    • Build procedures
  • Applications
    • NGINX Server with SSL

Server design

We will run Docker on a standard N-SCHOOL virtual machine running CentOS Stream 9. A single machine can host any number of applications, and each of those applications will have its own directory in /local/docker. For example, the www-nerdhole application will store its files in /local/docker/www-nerdhole. We call that directory the application home directory. We don't want to tie ourselves down too much for the directory structure. An application can use one or more containers, such as an application server, a database server, and a management tool such as we see in the my-app application. The following image illustrates the server topology:

Docker topology

The Docker server is a physical or virtual machine running the Docker daemon. It has a connection to the main network (frontnet), through which we can access the exported services of all the containers. As long as no two applications use the same ports, we can export as many services as we want.

I have decided I want to have direct access to the information used by the containers, so we will mount the /local/docker subdirectories and maybe select other directories on the container using the volumes feature. We can also use named volumes if we want. These are persistent between restarts of the container, but are stored where we may not want them.