This repository contains the code needed to with a number of IoT devices.
- Docker and Docker compose for Raspberry Pi - How To Install Docker and Docker-Compose On Raspberry Pi
- Windows or Linux operating system
- 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
- Assign a static I.P. address to this host
- Clone this repository onto your host
- Navigate to the directory containing the docker-compose file
- Replace the
<static-ip-address-here>
placeholder of the SECURITY_MICRO_SERVICE_BASE_URL environment variable with the value of the static I.P. address assigned in step 2 - Update any other environment variables as you please (but the defaults should suffice if you are following along with the Security with Machine Learning Spice Makes Everything Nice project)
- Execute
docker-compose up -d
in the same directory as thedocker-compose.yml
file
If you are stuck and need a hand, please reach out to me via email [email protected]