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
- Follow the steps under Configuring the Operating System to do the initial setup of the Raspberry Pi
- Clone the Farmalytics repo
- Install Git
sudo apt-get install git -y
- Clone the repo
git clone https://github.com/jonatello/farmalytics.git
- Enter the repo
cd farmalytics/Docker/RPi-Node
- Install Git
- Update the environment variables file
- Using your favorite text editor, update the information in
farmalytics.env
- Using your favorite text editor, update the information in
- Update the motion config file
- Using your favorite text editor, update the config information in
motion/motion.conf
- Using your favorite text editor, update the config information in
- Install Docker
- Install python and pip
sudo apt install -y python python-pip libffi-dev python-backports.ssl-match-hostname
- Download Docker install script
curl -sSL https://get.docker.com | sh
- Add current user to be able to run Docker commands without sudo
sudo usermod -aG docker $(whoami)
- Install docker-compose
sudo pip install docker-compose
- Install python and pip
- Build containers
docker-compose build
this can take about 5 minutes because it has to pull and build filebeat - Run the containers in attached mode to make sure there are no errors
docker-compose up
- Bring down the containers with ctrl+c
- Run the containers in daemon mode
docker-compose up -d
Elastic Stack Node
- Clone the Farmalytics repo
- Install Git
sudo apt-get install git -y
- Clone the repo
git clone https://github.com/jonatello/farmalytics.git
- Enter the repo
cd farmalytics/Docker/ELK
- Install Git
- Install Docker (steps here will depend on your operating system)
- Install docker-compose (steps here will depend on your operating system)
- Build comtainer
docker-compose build
- Run the container in attached mode to make sure there are no errors
docker-compose up
- Bring down the container with ctrl+c
- Run the container in daemon mode
docker-compose up -d
- Go to http://docker_host:5601 to view and configure Kibana (it may take a few minutes for it to finish initializing)