Deploy With Docker - jonatello/farmalytics GitHub Wiki

Docker

The goal of the Docker folder is to make the setup and configuration of the Raspberry Pi nodes and the ELK stack as simple as possible.

Raspberry Pi Node

  1. Follow the steps under Configuring the Operating System to do the initial setup of the Raspberry Pi
  2. Clone the Farmalytics repo
    1. Install Git sudo apt-get install git -y
    2. Clone the repo git clone https://github.com/jonatello/farmalytics.git
    3. Enter the repo cd farmalytics/Docker/RPi-Node
  3. Update the environment variables file
    1. Using your favorite text editor, update the information in farmalytics.env
  4. Update the motion config file
    1. Using your favorite text editor, update the config information in motion/motion.conf
  5. Install Docker
    1. Install python and pip sudo apt install -y python python-pip libffi-dev python-backports.ssl-match-hostname
    2. Download Docker install script curl -sSL https://get.docker.com | sh
    3. Add current user to be able to run Docker commands without sudo sudo usermod -aG docker $(whoami)
    4. Install docker-compose sudo pip install docker-compose
  6. Build containers docker-compose build this can take about 5 minutes because it has to pull and build filebeat
  7. Run the containers in attached mode to make sure there are no errors docker-compose up
  8. Bring down the containers with ctrl+c
  9. Run the containers in daemon mode docker-compose up -d

Elastic Stack Node

  1. Clone the Farmalytics repo
    1. Install Git sudo apt-get install git -y
    2. Clone the repo git clone https://github.com/jonatello/farmalytics.git
    3. Enter the repo cd farmalytics/Docker/ELK
  2. Install Docker (steps here will depend on your operating system)
  3. Install docker-compose (steps here will depend on your operating system)
  4. Build comtainer docker-compose build
  5. Run the container in attached mode to make sure there are no errors docker-compose up
  6. Bring down the container with ctrl+c
  7. Run the container in daemon mode docker-compose up -d
  8. Go to http://docker_host:5601 to view and configure Kibana (it may take a few minutes for it to finish initializing)