JAX JUGAUGUST 9, 2017
ANGULAR2+SPRING BOOT+DOCKER SWARM
ANGULAR2+SPRING BOOT+DOCKER SWARM
ABOUT ME
ā–ø Founded ScholarshipExperts.com (now unigo.com)
ā–ø Sr. Director of Engineering @ Schoolzilla
ā–ø Enterprise Solutions Architect @ Availity
ā–ø Connect with me
ā–ø LinkedIn
ā–ø GitHub http://github.com/erwindev
ā–ø Email: ealberto@icloud.com
ANGULAR2+SPRING BOOT+DOCKER SWARM
AGENDA
ā–ø Architecture Overview
ā–ø Build something in Angular2 using angular-cli
ā–ø Connect an Angular2 SPA to an API built in Spring Boot
ā–ø Use Docker to containerize the SPA and API Server
ā–ø Deploy the Docker containers in Docker Swarm
ANGULAR2+SPRING BOOT+DOCKER SWARM
ARCHITECTURE
ā–ø Architecture Components
ā–ø Single Page App built in JavaScript (Angular2)
ā–ø Spring Boot Microservices
ā–ø Database in PostgreSQL
ANGULAR2+SPRING BOOT+DOCKER SWARM
ARCHITECTURE
ā–ø Benefits
ā–ø Better User Experience
ā–ø Ease of Deployment
ā–ø Easier to Debug
ANGULAR2+SPRING BOOT+DOCKER SWARM
ARCHITECTURE
ā–ø Benefits
ā–ø Easy to Scale
ā–ø Distributed Load
ANGULAR2+SPRING BOOT+DOCKER SWARM
LET'S BUILD A SIMPLE ANGULAR2 APP
ā–ø We need…
ā–ø Node.js ($ brew install node)
ā–ø angular-cli ($ npm install -g @angular-cli)
ā–ø Let’s create an Angular2 app
ā–ø $ ng new test-angular-ui
ā–ø $ cd test-angular-ui
ā–ø $ ng serve --host=0.0.0.0 --port=4201
LET’S SEE SOME
CODE
ANGULAR2+SPRING BOOT+DOCKER SWARM
RECAP
ā–ø Setup a really simple Angular2 application
ā–ø Spun up College Tracker UI SPA
ā–ø Launched College Tracker API
ā–ø Integrated College Tracker UI SPA with the API
ā–ø How Session is handled in the application
LET’S
CONTAINERIZE
ANGULAR2+SPRING BOOT+DOCKER SWARM
DOCKER
ā–ø Tool to make it easy to develop, deploy and run
applications
ā–ø Containers
ā–ø Guarantee that your application is going to run the same
whichever environment it is running
ā–ø Eliminates ā€œworks on my machineā€ issue
ANGULAR2+SPRING BOOT+DOCKER SWARM
DOCKER
ā–ø We need…
ā–ø Docker Toolbox
ā–ø VirtualBox
ā–ø Dockerfile in your applications
LET’S RUN IT IN A
CLUSTER
ANGULAR2+SPRING BOOT+DOCKER SWARM
DOCKER SWARM
ā–ø Container orchestration
ā–ø Service Discovery
ā–ø Health checks
ā–ø Auto-[scaling/restart/healing] of containers
ā–ø Load Balancing
ā–ø Zero-downtime deploys
QUESTIONS?

Angular2, Spring Boot, Docker Swarm