This repository contains the code needed to run the python service needed to arm, disarm and silence the alarm as part of the Security with Machine Learning Spice Makes Everything Nice project.
- Docker and Docker compose for Raspberry Pi - How To Install Docker and Docker-Compose On Raspberry Pi
- Raspbian 11 (bullseye) OS version - Install Raspberry Pi OS Bullseye on Raspberry Pi (Illustrative Guide)
- Git - How to Install Git on Raspberry Pi
A docker swarm manager node needs to exist before proceeding. You will also need to know the token to join the swarm as a worker. If you do not yet have a host designated as a manager, the steps below need to be followed to create one:
- On the host designated as the manager, assign a static I.P. address to the host
- if you opted to use a host running Ubuntu to be the manager, please follow the guide Ubuntu Static I.P. Address to set it up.
- For a Raspberry Pi host please see How to Setup a Raspberry Pi Static IP Address
- For a Windows 10 machine - How to Assign a Static IP Address in Windows 7, 8, 10, XP, or Vista
- execute the command
docker swarm init --advertise-addrr <static-ip-address-from-step-1> - You will be presented with the token to be used to join the swarm as workers - note this command to be run later.
- On the host that will run the services defined in the docker-compose file, join the docker swarm using the command noted in step 3 of the pre-requisite section
- Clone this repository onto your Raspberry Pi
- Navigate to the directory containing the docker-compose file
- Update the relevant environment variables for specific configurations (but the default should suffice if you are following along with the Security with Machine Learning Spice Makes Everything Nice project)
- Execute
docker-compose upin the same directory as thedocker-compose.ymlfile
If you are stuck and need a hand, please reach out to me via email piandarduinoguy@gmail.com