self-goat-farmos/README.md
2024-06-12 23:05:02 -04:00

1.9 KiB

self-goat-farmos

Hosting files and documentation for the SELF + GOAT instance(s) of farmOS

Overview

The folder named "docker" has the Docker Compose files I used to self-host farmOS on a private server at my house. zrok provides the public IP address and TLS certificate and sends the public traffic over a secure tunnel to the private server.

  1. compose.yml - this file describes the two containers for farmOS
    1. www - the farmOS web application (Drupal)
    2. db - the database server (PostgreSQL)
  2. compose.override.yml - this file describes the zrok containers and was downloaded from the zrok Docker share guide.
    1. zrok-enable - uses the account token to enable an isolated zrok environment in a named volume
    2. zrok-share - runs zrok to reserve the unique name and proxy to the target URL

How To Host farmOS with Docker

These compose files are a complete solution for self-hosting farmOS with a few additional steps.

  1. Get a zrok account token and save it in a new file name .env in the same directory as the two compose files, e.g., ZROK_ENABLE_TOKEN=abcd1234.
  2. Set a long, random database password, also in the .env file, e.g., POSTGRES_PASSWORD=71adb2791158c0fdf81a0a48002646b107a62d16d33b2e6e1e
  3. In compose.override.yml, set variable ZROK_UNIQUE_NAME to the desired zrok subdomain, e.g. "selfgoatfarm" becomes https://selfgoatfarm.share.zrok.io.
  4. In case you're self-hosting zrok too, not using zrok.io, then you must set ZROK_API_ENDPOINT to your zrok controller's API endpoint.
  5. In the working directory with the compose files, say docker compose up --detach.

If everything works and you can visit farmOS at the zrok public share URL you specified then you're good. farmOS will auto-start if you reboot.

If it's not working then check the logs: docker compose logs --follow.