IRC logs for #farmOS, 2024-01-14 (GMT)

2024-01-13
2024-01-15
TimeNickMessage
[11:20:11]* shplorf[m] has joined #farmos
[11:22:28]<shplorf[m]>Hi, I'm just working on deploying the FarmOS Docker image. Is there anywhere I can find documentation of all the environment variables it can be configured with? I'm having trouble locating this info in the docs/GitHub. For example, I'd like to configure the DB hostname.
[11:23:31]* symbioquine[m] has joined #farmos
[11:23:31]<symbioquine[m]>That isn't directly configurable via an environment variable since it is part of Drupal's configuration.
[11:23:46]<symbioquine[m]>That said, there are ways to accomplish what I think you're trying to do.
[11:25:05]<shplorf[m]>I see, what is the pattern for configuring Drupal? Is there a config file I can mount?
[11:25:15]<shplorf[m]>Thanks for the quick reply BTW!
[11:27:02]<symbioquine[m]>You need to deal with the question of how two different scenarios get handled;
[11:27:02]<symbioquine[m]>* Under normal (everyday) start-up conditions, drupal is already configured
[11:27:02]<symbioquine[m]>* Under first-time start-up conditions you need to configure one or more drupal "sites"
[11:27:57]<symbioquine[m]>Many folks code their Docker setups for the everyday scenario and do the configuration manually on first start-up before using Drupal/farmOS.
[11:28:32]<symbioquine[m]>But it is possible to encode how you want that configuration to occur into your Docker image or something like a docker-compose.yml file...
[11:28:57]<shplorf[m]>Ah makes sense, so the DB hostname is configured in the UI on initial start-up?
[11:29:13]<symbioquine[m]>Yes
[11:29:21]<symbioquine[m]>symbioquine[m]: e.g. https://github.com/symbioquine/farmOS_wfs/blob/33e72466fb2a56f31bb1e494b...
[11:30:27]<symbioquine[m]>If you're just getting started, you probably want to spin up the Docker container with the minimal amount of custom stuff and use the UI to configure Drupal/farmOS (including the DB connection info)
[11:30:49]<symbioquine[m]>Then presumably, you can decide what a production deployment looks like for you and what bits need to be automated.
[11:32:49]<shplorf[m]>Makes sense, thanks! I do see some things configured via env vars in some of the examples/docs, so I'd still be interested in a comprehensive list of all possible env vars I can set for the image, if that exists.
[11:34:19]<mstenta[m]>shplorf: this documents available "build arguments": https://farmos.org/development/environment/docker/
[11:35:42]<mstenta[m]>farmOS docker images don't make use of any persistent ENV variables (at least not off the top of my head)
[11:36:07]<symbioquine[m]>It's not hard to wire it up to do so though. e.g. https://blog.chrismitchellonline.com/posts/drupal-environment-variables/
[11:37:14]<mstenta[m]>The base images that farmOS builds upon (PHP, Drupal, etc) may have some, I'm not sure
[11:37:55]<symbioquine[m]>I suspect there's very few (of the "set the DB URL" variety) because there's open issues like: https://www.drupal.org/project/drupal/issues/2501901
[11:38:18]<symbioquine[m]>and the related issue: https://www.drupal.org/project/drupal/issues/2827765
[11:38:32]<mstenta[m]>Yea Drupal itself doesn't use environment variables, that I know of
[11:39:20]<symbioquine[m]>Another example of wiring up Drupal to honor environment variables: https://github.com/geerlingguy/drupal-container/blob/ff4d446ac7ad05d666b...
[11:40:00]<symbioquine[m]>Another relevant issue: https://www.drupal.org/project/drupal/issues/2879846
[11:40:18]<shplorf[m]>Awesome, thanks all, I have a tendency to over-engineer stuff by trying to anticipate what I'd like to change down the road, sounds like I just need to spin it up and worry about how to change/configure things when I actually find something I'd like to change/configure.
[11:41:04]<symbioquine[m]>Pro tip: Spend the energy on learning to take/restore backups first
[11:41:42]<symbioquine[m]>Then you can iterate on your setup more easily in the future (and sleep well at night)
[11:42:21]<shplorf[m]>Which is just the farm DB + /opt/drupal/web/sites, right? That's where all the state lives?
[11:43:31]<symbioquine[m]>This is what I do...... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/nqWIQrqgBdmNFvwl...)
[11:44:50]<symbioquine[m]>Then I run it as a cron job from another container;... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/nmZelaENcjWruqlN...)
[11:45:49]<shplorf[m]>Makes sense, thanks!
[11:47:23]<symbioquine[m]>**farmos_wipe_and_recreate_from_backup.sh**... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/RURNXffTlMjgksQv...)
[11:47:36]<symbioquine[m]>s/**farmos_wipe_and_recreate_from_backup/**`farmos\_wipe\_and\_recreate\_from\_backup/, s/**/`**/
[11:47:51]<symbioquine[m]>s/**/**`/, s/**/`**/
[11:48:06]<symbioquine[m]>s/*/**`/, s/*:/`**:/
[11:48:47]<symbioquine[m]>A lot of that is fairly specific to hosting in Docker Compose, but hopefully is still instructive.
[11:53:16]<symbioquine[m]>There might be better ways to do all that too. I'm by no means an expert in managing Drupal installs 🌱
[13:10:43]<shplorf[m]>In the initial configuration on connecting to the container, is the "Site Name" the hostname where farmos will be deployed? What is that string used for?
[13:11:33]<mstenta[m]>Site name in the context of farmOS is usually the farm name
[13:12:31]<mstenta[m]>(Might be a good idea to override the Drupal default form to make that more clear... 🤔)
[13:12:47]<shplorf[m]>OK, and this can be a "pretty" name, so it can contain spaces n stuff?
[13:12:54]<mstenta[m]>Yup!
[13:13:22]<mstenta[m]>"Shplorf's Gourmet Beet Farm" :-)