User Tools

Site Tools


eolab:ioa:offline_farmos:installing_farmos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
eolab:ioa:offline_farmos:installing_farmos [2022/09/28 16:35] jan001eolab:ioa:offline_farmos:installing_farmos [2022/09/28 16:59] jan001
Line 1: Line 1:
 ====== Installing FarmOS ====== ====== Installing FarmOS ======
  
 +"farmOS is a web-based application for farm management, planning, and record keeping. It is developed by a community of farmers, developers, researchers, and organizations with the aim of providing a standard platform for agricultural data collection and management." ([[https://farmos.org/|farmos.org]], 2022)
  
 +So I have one good news and one bad news for you. Fortunately, FarmOS can be run inside a Docker container. Unfortunately by the time of writing this guide, there is no prebuild container for running FarmOS on the Raspberry Pi. The Raspberry Pi´s CPU has a completely different architecture than your normal PC does. But no worries, it is pretty easy to let it run on our small Pi. Docker normally pulls a so-called image (a building plan for a container) from a hub called Docker Hub. But the software needs to be made available for all the different CPU architectures out there. FarmOS is only available for normal PCs by default (amd64). But the main developers of FarmOS made it easy to build it for your specific architecture.
 +
 +First, we will download the software from GitHub ([[https://github.com/farmOS/farmOS|FarmOS on GitHub]]), and then we are going to build it for our Raspberry Pi.
 +
 +<cli>
 +pi@ioa-webserver:~ $ sudo apt install git
 +pi@ioa-webserver:~ $ mkdir git
 +pi@ioa-webserver:~ $ cd git
 +pi@ioa-webserver:~/git $ git clone -b 2.x https://github.com/farmOS/farmOS.git
 +pi@ioa-webserver:~/git $ cd farmOS/docker
 +pi@ioa-webserver:~/git $ sudo docker build -t farmos .
 +</cli>
 +
 +We now have everything set to start our FarmOS instance.
 +Now we need to configure how we want to run our instance. Because we also need a separate database for running FarmOS, we will use Docker Compose. With Docker Compose we can define all our wanted services in one file and be able to start and stop them easily.
 +
 +<cli>
 +pi@ioa-webserver:~/git $ cd /home/pi
 +pi@ioa-webserver:~ $ mkdir farmOS
 +pi@ioa-webserver:~ $ cd farmOS
 +pi@ioa-webserver:~/farmOS $ nano docker-compose.yml
 +</cli>
 +
 +With nano you can now create and edit the configuration file. Nano is a text-editor.
 +
 +<file yml docker-compose.yml>
 +version: '3'
 +services:
 +  db:
 +    image: postgres:12
 +    volumes:
 +      - './db:/var/lib/postgresql/data'
 +    ports:
 +      - '5432:5432'
 +    environment:
 +      POSTGRES_USER: farm
 +      POSTGRES_PASSWORD: farm
 +      POSTGRES_DB: farm
 +
 +  www:
 +    depends_on:
 +      - db
 +    image: farmos:latest
 +    volumes:
 +      - './www:/opt/drupal'
 +    ports:
 +      - '8080:80'
 +</file>
eolab/ioa/offline_farmos/installing_farmos.txt · Last modified: 2022/09/28 17:06 by jan001