Post on 13-Apr-2017
Micro Services for Lazy DevelopersEugene Krevenets
github: http://hyzhak.github.io
Docker
Intro / Laziness
Intro / Other tools
Intro / All in one
Intro / My experience
node + mongodb
node + postgres
python + postgres
and more
...
Intro / My other experience
sometimes they come back
How does it works / Lightweight
Containers operate at the process level - runC (libcontainer)
How does it works / Isolated
Single Responsibility. One service - On Container
Share resource between containers (Volume, Network)
How does it works / Command line
How does it works / Kitematic
How does it works / For None-Linux Users
Docker-machine
(VirtualBox)
Docker-compose
Docker
Lets play / Inheritance
Lets play / Solo for Nodejs
FROM node:5.2RUN mkdir /appWORKDIR /appCOPY package.json /app/RUN npm install
Lets play / Solo for Python
FROM python:3.5.0RUN apt-get update && \ apt-get install -y libmemcached-devRUN mkdir /appCOPY requirements.txt /app/WORKDIR /appRUN pip3 install -r requirements.txt
Lets play / Docker Hub
Lets play / Ready made Images
Lets play / Django Duet
db: image: postgresweb: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" links: - db
Lets play / Start it
$ docker-compose up
Lets play / Start it. Log
Pit trap
Learning curve
Build time (Layering)
File refresh (use nodemon --legacy-watch key)
Performance
Dockerfile should be at the top
Sometimes Linux VM can breaks itself (VirtualBox)
Thanks! Questions?
My Contacts Eugene Krevenetsgithub: http://hyzhak.github.iotwitter: hyzhak / hyzhak_en