Local Dev Environment for
micro service with Docker
Julian Shen, LINE Taiwan
- Micro services
- What’s the problems
- Containers & Docker
- Solve the problems
Agenda
Micro services
API
Gateway
service 1rest
service 2rest
service 3rest
service 4rest
service 5rest
Web UI Database
message bus
What’s the problem?
I am only in charge of some services
Too many dependencies
Not easy to setup development env in minutes
Not easy test before commit codes
As a developer
Develop with an alpha Env
API
Gateway
service 1rest
service 2rest
service 3rest
service 4rest
service 5rest
Web UI Database
message bus
What you really care
What you might do
develop commit
deploy to
alpha
test with
other services
take long time
develop
test with with
mocked data
OR
commit deploy
not precise
You need full environment on your
computer
Ease to setup development env in minutes
Using Docker for development
Having a consistent env for testing at local
Ease to swap components
Using Docker for development
API
Gateway
service 1rest
service 2rest
service 3rest
service 4rest
service 5rest
Web UI Database
message bus
version 1container container
container
container
container
container container
container
container
branch a
branch b
local codes
Packing container image
docker file
app config
build
build script
image
source
get from git
git
deploy
registry
Packing container image for development
docker file
app config
build
build script
image
source
Linked using volume
local storage
mount volume
building codes
running app
booting container
Using Docker-compose to run all
version: 3
services:
service1:
build: .
depends_on:
- redis
ports:
- “80:80”
service2:
image: “service2:branch_a”
redis:
image: redis
service 1 service 2
Redis
docker-compose.yml
after running “docker-compose up”
Using smaller base images
Avoid installing unnecessary packages
One concern for one container
Tag version with git information for dev image
Tips
Thank you

Local development environment for micro services with docker

  • 2.
    Local Dev Environmentfor micro service with Docker Julian Shen, LINE Taiwan
  • 3.
    - Micro services -What’s the problems - Containers & Docker - Solve the problems Agenda
  • 4.
    Micro services API Gateway service 1rest service2rest service 3rest service 4rest service 5rest Web UI Database message bus
  • 5.
    What’s the problem? Iam only in charge of some services Too many dependencies Not easy to setup development env in minutes Not easy test before commit codes As a developer
  • 6.
    Develop with analpha Env API Gateway service 1rest service 2rest service 3rest service 4rest service 5rest Web UI Database message bus What you really care
  • 7.
    What you mightdo develop commit deploy to alpha test with other services take long time develop test with with mocked data OR commit deploy not precise
  • 8.
    You need fullenvironment on your computer
  • 9.
    Ease to setupdevelopment env in minutes Using Docker for development Having a consistent env for testing at local Ease to swap components
  • 10.
    Using Docker fordevelopment API Gateway service 1rest service 2rest service 3rest service 4rest service 5rest Web UI Database message bus version 1container container container container container container container container container branch a branch b local codes
  • 11.
    Packing container image dockerfile app config build build script image source get from git git deploy registry
  • 12.
    Packing container imagefor development docker file app config build build script image source Linked using volume local storage mount volume building codes running app booting container
  • 13.
    Using Docker-compose torun all version: 3 services: service1: build: . depends_on: - redis ports: - “80:80” service2: image: “service2:branch_a” redis: image: redis service 1 service 2 Redis docker-compose.yml after running “docker-compose up”
  • 14.
    Using smaller baseimages Avoid installing unnecessary packages One concern for one container Tag version with git information for dev image Tips
  • 15.