An application that will collect data from sensor information coming from a Raspberry Pi.
run mvn clean install
java -jar -Dspring.profiles.active=dev monitor-server.jar
Navigate to http://localhost:8080/swagger-ui.html# to view rest APIs.
- Create a Docker Machine (hopefully you an reuse one in your infrastructure).
- Git clone this repo on your Docker Machine: https://github.com/polinchw/docker-tools
- chmod u+x docker-tools/docker-machine/docker-swarm/aws/bash-scripts/create-swarm-instances.sh
- Create a Docker Swarm under the control of the Docker Machine to run the monitor-frontend on. This will install the Docker Swarm on your selected AWS VPC and subnet.
./docker-tools/docker-machine/docker-swarm/aws/bash-scripts/create-swarm-instances.sh AKIAJB7DZD4I6QA2XBRA xxx vpc-9dc174e4 subnet-8102b5ad polinchw monitorserver 1 ami-8887be9e AppSecurityGroup
- Create a Docker Service. Run the monitor-frontend app in the Docker Swarm as a Docker Service by running this command on the Docker Machine.
docker-machine ssh monitorserver-swarm-master 'docker service create -e "SPRING_PROFILES_ACTIVE=aws-dev" -e "JASYPT_ENCRYPTOR_PASSWORD=xxx" --replicas 2 --name monitor-server -p 8080:8080 polinchw/monitor-server'
- You probably want to add a AWS load balancer to load balance the monitor-frontend at this point.
-
To run the app with docker compose with a targeted environment run:
docker-compose build
docker-compose -f docker-compose.yml -f dev-local.yml up