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.

    systemd─┬─ModemManager───2*[{ModemManager}]
            ├─NetworkManager─┬─dhclient
            │                └─2*[{NetworkManager}]
            ├─accounts-daemon───2*[{accounts-daemon}]
            ├─2*[agetty]
            ├─atd
            ├─containerd─┬─containerd-shim─┬─boot───runsvdir─┬─runsv───rsyslogd───2*[{rsyslogd}]
            │            │                 │                 ├─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}]
            ├─cron
            ├─dbus-daemon
            ├─dockerd─┬─docker-proxy───8*[{docker-proxy}]
            │         ├─docker-proxy───7*[{docker-proxy}]
            │         └─16*[{dockerd}]
            ├─irqbalance───{irqbalance}
            ├─lvmetad
            ├─lxcfs───4*[{lxcfs}]
            ├─networkd-dispat───{networkd-dispat}
            ├─polkitd───2*[{polkitd}]
            ├─rsyslogd───3*[{rsyslogd}]
            ├─sshd───sshd───sshd───bash───pstree
            ├─sudo───docker───11*[{docker}]
            ├─systemd───(sd-pam)
            ├─systemd-journal
            ├─systemd-logind
            ├─systemd-resolve
            ├─systemd-timesyn───{systemd-timesyn}
            ├─systemd-udevd
            └─wpa_supplicant
boot───runsvdir─┬─runsv───rsyslogd───2*[{rsyslogd}]
                ├─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]

EDIT

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.

2 Likes