I plan to deploy farmos to kubernetes and was kind of remembering seeing a base dockerfile that I could use to build my own docker image with the modules I want where it builds the farmos installation with composer. But either I dreamt that or I’m not that good at searching now because I cant find it anywhere. DO anybody here now of any or is the best thing just borrowing the Dockerfile from the farmos github repo and try to modify it to fit my setup?
Hi @jorblad - there is some documentation on farmOS.org about how to build farmOS with Composer:
At the bottom of that page is an example Dockerfile
for building a production image with your own Composer build.
I recommend reading that entire page to learn how everything works. It’s good to understand the distinction between “farmOS” and your “composer project” which is essentially your own composer.json
that you maintain, which pulls farmos/farmos
in as a dependency, along with any other modules you want.
This is essentially the same process we use to build the “official” farmOS Docker images. We just use the “default” composer.json
from GitHub - farmOS/composer-project, which doesn’t include any additional modules.
Hope that gets you headed in the right direction!
That was probably the one I was remembering seeing, weird that I didn’t see that today
Getting farmOS running in a container is the easy part.
This might be obvious, but you’ll also need address some other details:
- Have a persistent/shared filesystem between all nodes - used for uploads and possibly CSS/JS aggregation/caching
- Automatically populate the key data,
settings.php
(and possiblysites.php
) for new nodes - including secrets which you may or may not want baked into your container image - Load balancing - table stakes for running stuff in k8s (slightly non-trivial if you’re running your own bare-metal cluster instead of using a cloud service)
- DB Hosting - could require some thought if you’re rolling your own db hosting on the same cluster
These are all general problems shared with Drupal so you should be able to find good resources/tutorials.
Yes and all that I’m still learning, the storage I will do with longhorn, populating key data I don’t know yet but will look into how to do that, loadbalancing from web entry I do with metallb and db hosting I use cloudnative-pg to simplify getting a good db setup. Yes I’m going to look for drupal guides a lot because there I’m not alone in running it in kubernetes while I don’t think there are that many running farmos in kubernetes.
Well this migration will have to pause for a while until I can get more storage for my kubernetes cluster because even though farmos don’t need that much space I was already starting to run out of space…