Since I rarely give insights on how websites such as this one are run, I decided it would be a great time to share one very simplistic and efficient approach to host several small websites, separated from each other, on a cheap VPS.
When we talk websites, I mean WordPress instances. WordPress has a few basic requirements:
- the PHP scripting-language
- a MySQL database
- possiblity to use sendmail or a similar software to send mails
To achieve these basic requirements, I employ:
- one docker-compose stack bundling the MySQL-database as well as the phpMyAdmin-webinterface
- multiple docker-compose stacks bundling PHP-FPM, nginx as well as exim4 to act as a mailrelay
- one nginx instance on the VPS (uncontainered as of now) that does the SSL-offloading and acts as a reverse proxy in front of the different docker-compose stacks for WordPress
The setup is:
- simple
- easy to handle (upgrades, PHP-version switching etc.)
- efficient (especially towards RAM usage)
- easily migrateable to a different machine