Composing Docker Compose Applications

Vlad Stirbu

Docker Meetup Tampere

27.04.2017

whoami

Vlad Știrbu

Principal Software Engineer

Nokia Technologies, Digital Health

 

vlad.stirbu@nokia.com

@VladStirbu

github.com/vstirbu

Content

Target environment overview

Development to production

How to compose apps

Medical grade IoT system...

...and the decomposition

Buzzwords

Microservices

Containers

Microservice basic artefacts

µservice
µservice
Dockerfile
Dockerfile

Flat deployment

Data acquisition
Data acquisition
Kafka
Kafka
Storm
Storm
Data persistence
Data persistence
Perimeter
Perimeter
Database
Database
Authentication
Authentication

Docker compose...

version: '2'
services:
  web:
    build: .
    ports:
     - "5000:5000"
    volumes:
     - .:/code
    depends_on:
     - redis

  redis:
    image: "redis:alpine"
web
web
redis
redis

µservice with dependencies

µservice
µservice
Dockerfile
Dockerfile
docker-compose.yml
docker-compose.yml

Structured deployment view

Data acquisition
Data acquisition
Authentication
Authentication
Kafka
Kafka
Storm
Storm
Data persistence
Data persistence
Database
Database
Perimeter
Perimeter

Compose aggregation

version: '2'
services:
  data-aquisition:
    depends_on:
     - authentication
     - kafka


  kafka:
    image: "kafka"
version: '2'
services:
  authentication:
    depends_on:
     - database

  database:
    image: "database"
COMPOSE_FILE=data-aquisition.yml:authentication.yml

Sharing compose files?

µservice
µservice
Dockerfile
Dockerfile
docker-compose.yml
docker-compose.yml
µservice
µservice
?
[Not supported by viewer]
docker-compose.yml
docker-compose.yml

Yeoman

Yeoman is a generic scaffolding system allowing the creation of any kind of app.

 

Yeoman is language agnostic. It can generate projects in any language

 

Yeoman by itself doesn't make any decisions. Every decision is made by generators which are basically plugins in the Yeoman environment.

...with a yeoman generator

µservice
µservice
Dockerfile
Dockerfile
package.json
package.json
µservice
µservice
docker-compose.yml
docker-compose.yml
generator
generator

Workflow

npm install -g yo

yo {microservice-generator}

docker-compose build

docker-compose up

Demo time

Conclusions

  • Manage only the direct dependencies
  • Leverage existing infrastructure
  • Flexible workflow

Questions

https://slides.com/vladstirbu/composing-docker-compose-applications

Made with Slides.com