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

31 lines
No EOL
1.9 KiB
Markdown

# 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)
1. `db` - the database server (PostgreSQL)
1. `compose.override.yml` - this file describes the zrok containers and was downloaded from [the zrok Docker share
guide](https://docs.zrok.io/docs/guides/docker-share/docker_public_share_guide/).
1. `zrok-enable` - uses the account token to enable an isolated zrok environment in a named volume
1. `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`.
1. Set a long, random database password, also in the `.env` file, e.g., `POSTGRES_PASSWORD=71adb2791158c0fdf81a0a48002646b107a62d16d33b2e6e1e`
1. In `compose.override.yml`, set variable `ZROK_UNIQUE_NAME` to the desired zrok subdomain, e.g. "selfgoatfarm" becomes https://selfgoatfarm.share.zrok.io.
1. 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.
1. 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`.