Docker Discourse Host OS Standard Operating Procedures

There are many how to posts which are great but there is one I can not find or does not exist that includes:

  • For those self-hosting, how to configure the host OS, such as Ubuntu, for only hosting the Docker container.
  • Once the site is running what are standard operating procedures one should take with the hosting OS, e.g. checking for hacks, how to transition from the hosting OS into the container, how to store basic information in preparation of a problem, etc.

I do realize that for each different OS and site the manual will be different but there are many things that will also be common.

Since the OS is only going to run a Docker container there will be extraneous files and services but what is extraneous? Does one need a GUI and all of the needed machinery and packages?

Once the site is running if something should happen and the site goes down it is necessary to have details of the site such as how it is configured, steps to rebuild from scratch, which version of running software, etc. Which of these kind of details matter? I have a good idea but it would be nice to see what others think and know from experience.

As an example in creating a SOP (Standard Operating Procedures) for our site here are the different results of pstree, one from the host OS and one from within the Docker container. Does the host really need all of those processes? In the next few days I am sure I will know the answer but maybe others already know and can share with us.

            │                └─2*[{NetworkManager}]
            │            │                 │                 ├─runsv───cron
            │            │                 │                 ├─runsv───unicorn_launche─┬─ruby─┬─ruby───22*[{ruby}]
            │            │                 │                 │                         │      ├─6*[ruby───8*[{ruby}]]
            │            │                 │                 │                         │      ├─2*[ruby───9*[{ruby}]]
            │            │                 │                 │                         │      └─5*[{ruby}]
            │            │                 │                 │                         └─sleep
            │            │                 │                 ├─runsv─┬─redis-server───3*[{redis-server}]
            │            │                 │                 │       └─svlogd
            │            │                 │                 ├─runsv─┬─postmaster───9*[postmaster]
            │            │                 │                 │       └─svlogd
            │            │                 │                 └─runsv───nginx───5*[nginx]
            │            │                 └─10*[{containerd-shim}]
            │            └─18*[{containerd}]
            │         ├─docker-proxy───7*[{docker-proxy}]
            │         └─16*[{dockerd}]
                │                         │      ├─6*[ruby───8*[{ruby}]]
                │                         │      ├─2*[ruby───9*[{ruby}]]
                │                         │      └─5*[{ruby}]
                │                         └─sleep
                │       └─svlogd
                │       └─svlogd


For a minimal configuration of Ubuntu see: Minimal Ubuntu
Note: I have not tried this at present but just passing along.

What is old is and works is typically still valid. See: Discourse in a Docker container by Sam. :grinning:
Gives a lot of insight into the history of using Discourse in Docker and how it works.

1 Like