SlideShare a Scribd company logo
1 of 36
Download to read offline
A bitcoin broker on Docker
Mathieu Buffenoir
@MBuffenoir
Sebastien Goasguen
@sebgoa
1
Mathieu Buffenoir
CTO Bity.com
VP of Swiss Bitcoin Association
@MBuffenoir
Sebastien Goasguen
VP Apache CloudStack
Author of O’Reilly Docker cookbook
@sebgoa
Outline
What is Bity ?
From nothing to Docker
Docker-compose in dev env
Ansible for cloud providers
Ansible for docker orchestration
Lessons learned
Future
4
What is Bity.com ?
Buy, sell and store bitcoins
Regulated
Hosted in Switzerland
Small team
Fast-moving space
5
6
Our needs
Follow the “Twelve factor” app recommendations.
Scalable, CI/CD -> Docker
Cloud (Paas) + Hosted in Switzerland -> Exoscale
Our tech stack
8
Infrastructure design
9
Zero to Prod in 8 months ?
“It works on my machine” syndrome
Gain velocity
Increased team collaboration
Thanks to :
Increased reproducibility
Easy portability
Difficulty on-boarding developers
Difficulty developing across team due to time to setup
environment
Teams working on different part of the infrastructure
Challenges to gain velocity
Steps
Nothing to Docker
Code on developer laptop with custom environment
Zero portability (i.e /source/tree )
Use of Vagrant box
Reproducibility of development environment (i.e /
source/tree/Vagrantfile )
Use of Vagrant box and Docker
Build image for applications and publish for
collaboration (i.e /source/tree/Dockerfile
+Vagrantfile)
$ docker build -t sbex/bity .

$ docker run -d -p 80:80 sbex/bity
Private repositories on Bitbucket
Private repositories on Docker Hub
Automated builds
Web Hooks from Bitbucket to Docker hub
Web Hooks from DockerHub to Jenkins
Docker Hub
dev server:
$ docker-compose up
CI/CD for dev
16
One docker-compose file to deploy entire infra
Great for developers and testing
Used to test parts of applications with latest image
from repo
Used prior to merging in staging
Docker-compose for dev env
17
One compose file to run all infra in dev
18
Impossible to run command inside containers
How to deal with secrets ?
At the time, no Swarm so compose was a single host
dev tool
Limitations of compose
19
Going to production in the cloud
20
Choosing a Cloud and “config” tool
Need a Swiss sovereign cloud
Need a tool to configure:
security groups
key pairs
manage instances
Not a configuration management tool to deploy apps.
Dev (server or laptop + docker-compose) on bitcoin-testnet
Staging (cloudstack + ansible) on bitcoin-testnet
Prod (cloudstack + ansible) on bitcoin-mainnet
separate branches for code and different image tags
21
Environments
$ git merge dev
staging tags
$ ansible-playbook deploy.yml
staging environment
Deploying on staging env
23
Create Cloud Infrastructure at Will
- name: Start Backend VM
local_action:
module: cloudstack_vm
name: backendpublic
template: "{{ template }}"
service_offering: "{{ instance_type }}"
security_groups: [ 'backend_public' ]
ssh_key: "{{ ssh_key }}"
user_data: "{{ lookup('file', '../files/backend_userdata.yml') }}"
register: backend_public
tags: create_vm
Ansible CloudStack module
- name: backend SecGroup
local_action:
module: cloudstack_sg
name: database
description: Backend public
tags: secgroup
25
Ansible Docker module in Ansible core
Deploying/Managing containers with
Ansible
26
- name: Set Docker login credentials
command: docker login -u foobar -e {{hub_email}} --password={{hub_password}}
- name: Docker pull sbex/angular-frontend
command: docker pull sbex/angular-frontend
- name: Start bity
docker:
image: sbex/angular-frontend
detach: true
restart_policy: always
name: bity
ports: 80:80
tags: start_container
Ansible docker module
27
Ansible and logdriver
- name: Start backend public
docker:
name: backend
image: sbex/backend
restart_policy: always
volumes:
- /app/_env:/usr/src/app/_env:ro
detach: true
ports: 8000:8000
log_driver: syslog
log_opt:
syslog-address: udp://{{hostvars['logserver'].ansible_ssh_host}}:5000
syslog-facility: local0
syslog-tag: backendpublic
28
Ansible to configure containers
- name: Create directory for settings
file: path=/app/_env state=directory
- name: Create json settings from template
template: src=env.j2 dest=/app/_env/env.json
...
- name: Create tables
command: docker exec -ti backend ./manage.py migrate
29
Dealing with secrets
No secrets in container images
Use Ansible vault to encrypt all secrets in playbooks stored in bitbucket
$ ansible-vault create /path/to/file.yml
$ ansible-vault encrypt /path/to/file.yml
$ ansible-vault decrypt /path/to/file.yml
$ ansible-vault rekey /path/to/file.yml
30
Container “Orchestration”
Every application has its role
Several playbooks
$ ansible-playbook deploy.yml
$ ansible-playbook upgrade.yml
$ ansible-playbook stop.yml
$ ansible-playbook start.yml
31
Early on:
Logspout to ELK
Now:
Logdriver (ansible 2.0) syslog driver to logstash with ELK
Test/deploy monitoring with docker-compose.
Logging
32
ElasticSearch 1.7 (+data container)
Logstash 1.5.3 (+conf for elk logs)
Kibana 4 (+Dashboard for elk logs)
cAdvisor (Collect & View containers performance)
Ngnix Proxy 1.9.3 (for SSL + password access).
One docker-compose runs
33
34
Container restart -> thanks to restart policy (docker > 1.6)
Weird Ansible docker behavior at times
Config as volume mounts (Too many env variables to handle)
Cannot use compose in prod yet (vault, execute commands
inside containers )
Lessons Learned
35
Currently using Ubuntu
Investigate the use of Docker optimized OS (e.g coreOS,
Atomic, RancherOS)
Need Easy upgrade of Docker versions
With new versions every 2 months, and possible change of
recommended storage driver, we need an easy way to cleanly
upgrade production systems
Investigate the use of a Docker orchestrator, possible
replacing Ansible docker module
(e.g Swarm, Kubernetes, tutum…)
Future
Thank you!MATHIEU BUFFENOIR
@MBuffenoir

mathieu@bity.com
@sebgoa

runseb@gmail.com
SEBASTIEN GOASGUEN

More Related Content

What's hot

Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013Trevor Roberts Jr.
 
Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Trevor Roberts Jr.
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsThomas Chacko
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructureDaegwon Kim
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングYuji ODA
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境謝 宗穎
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作kao kuo-tung
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker ComposeJustin Crown
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Binary Studio
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chefbridgetkromhout
 
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)Erica Windisch
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Binary Studio
 
Docker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - MachineDocker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - MachineMario IC
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleDmytro Slupytskyi
 
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...Atlassian
 
GDG Lima - Docker Compose
GDG Lima - Docker ComposeGDG Lima - Docker Compose
GDG Lima - Docker ComposeMario IC
 

What's hot (20)

Docker up and running
Docker up and runningDocker up and running
Docker up and running
 
Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013Couch to OpenStack: Cinder - August 6, 2013
Couch to OpenStack: Cinder - August 6, 2013
 
Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013
 
Docker / Ansible
Docker / AnsibleDocker / Ansible
Docker / Ansible
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and Windows
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
 
Docker Overview
Docker OverviewDocker Overview
Docker Overview
 
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
 
Docker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - MachineDocker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - Machine
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and Ansible
 
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
AtlasCamp 2015: The age of orchestration: From Docker basics to cluster manag...
 
GDG Lima - Docker Compose
GDG Lima - Docker ComposeGDG Lima - Docker Compose
GDG Lima - Docker Compose
 

Similar to 2015 DockerCon Using Docker in production at bity.com

DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDocker, Inc.
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 augVincent De Smet
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
Serverless Container with Source2Image
Serverless Container with Source2ImageServerless Container with Source2Image
Serverless Container with Source2ImageQAware GmbH
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-imageJosef Adersberger
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM BluemixContinuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM BluemixFlorian Georg
 
Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...
Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...
Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...Michael Hofmann
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerPhil Estes
 
Microservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformMicroservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformSunnyvale
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioJérôme Petazzoni
 
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQDocker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQErica Windisch
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessDocker-Hanoi
 
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2days
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2daysUsing Kubernetes for Continuous Integration and Continuous Delivery. Java2days
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2daysCarlos Sanchez
 
Using Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous DeliveryUsing Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous DeliveryCarlos Sanchez
 

Similar to 2015 DockerCon Using Docker in production at bity.com (20)

DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with Docker
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Serverless Container with Source2Image
Serverless Container with Source2ImageServerless Container with Source2Image
Serverless Container with Source2Image
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-image
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Mihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate EverythingMihai Criveti - PyCon Ireland - Automate Everything
Mihai Criveti - PyCon Ireland - Automate Everything
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM BluemixContinuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
Continuous Delivery of Cloud Applications with Docker Containers and IBM Bluemix
 
Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...
Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...
Developer Experience Cloud Native - From Code Gen to Git Commit without a CI/...
 
Docker intro
Docker introDocker intro
Docker intro
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in Docker
 
Microservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud PlatformMicroservices DevOps on Google Cloud Platform
Microservices DevOps on Google Cloud Platform
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQDocker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2days
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2daysUsing Kubernetes for Continuous Integration and Continuous Delivery. Java2days
Using Kubernetes for Continuous Integration and Continuous Delivery. Java2days
 
Using Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous DeliveryUsing Kubernetes for Continuous Integration and Continuous Delivery
Using Kubernetes for Continuous Integration and Continuous Delivery
 

Recently uploaded

VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts servicevipmodelshub1
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一3sw2qly1
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Roomdivyansh0kumar0
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 

Recently uploaded (20)

VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts serviceChennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
Chennai Call Girls Alwarpet Phone 🍆 8250192130 👅 celebrity escorts service
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
定制(CC毕业证书)美国美国社区大学毕业证成绩单原版一比一
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130  Available With RoomVIP Kolkata Call Girl Kestopur 👉 8250192130  Available With Room
VIP Kolkata Call Girl Kestopur 👉 8250192130 Available With Room
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 

2015 DockerCon Using Docker in production at bity.com

  • 1. A bitcoin broker on Docker Mathieu Buffenoir @MBuffenoir Sebastien Goasguen @sebgoa 1
  • 2. Mathieu Buffenoir CTO Bity.com VP of Swiss Bitcoin Association @MBuffenoir Sebastien Goasguen VP Apache CloudStack Author of O’Reilly Docker cookbook @sebgoa
  • 3. Outline What is Bity ? From nothing to Docker Docker-compose in dev env Ansible for cloud providers Ansible for docker orchestration Lessons learned Future
  • 4. 4 What is Bity.com ? Buy, sell and store bitcoins Regulated Hosted in Switzerland Small team Fast-moving space
  • 5. 5
  • 6. 6 Our needs Follow the “Twelve factor” app recommendations. Scalable, CI/CD -> Docker Cloud (Paas) + Hosted in Switzerland -> Exoscale
  • 9. 9 Zero to Prod in 8 months ?
  • 10. “It works on my machine” syndrome Gain velocity Increased team collaboration Thanks to : Increased reproducibility Easy portability
  • 11. Difficulty on-boarding developers Difficulty developing across team due to time to setup environment Teams working on different part of the infrastructure Challenges to gain velocity
  • 12. Steps
  • 13. Nothing to Docker Code on developer laptop with custom environment Zero portability (i.e /source/tree ) Use of Vagrant box Reproducibility of development environment (i.e / source/tree/Vagrantfile ) Use of Vagrant box and Docker Build image for applications and publish for collaboration (i.e /source/tree/Dockerfile +Vagrantfile) $ docker build -t sbex/bity .
 $ docker run -d -p 80:80 sbex/bity
  • 14. Private repositories on Bitbucket Private repositories on Docker Hub Automated builds Web Hooks from Bitbucket to Docker hub Web Hooks from DockerHub to Jenkins Docker Hub
  • 15. dev server: $ docker-compose up CI/CD for dev
  • 16. 16 One docker-compose file to deploy entire infra Great for developers and testing Used to test parts of applications with latest image from repo Used prior to merging in staging Docker-compose for dev env
  • 17. 17 One compose file to run all infra in dev
  • 18. 18 Impossible to run command inside containers How to deal with secrets ? At the time, no Swarm so compose was a single host dev tool Limitations of compose
  • 19. 19 Going to production in the cloud
  • 20. 20 Choosing a Cloud and “config” tool Need a Swiss sovereign cloud Need a tool to configure: security groups key pairs manage instances Not a configuration management tool to deploy apps.
  • 21. Dev (server or laptop + docker-compose) on bitcoin-testnet Staging (cloudstack + ansible) on bitcoin-testnet Prod (cloudstack + ansible) on bitcoin-mainnet separate branches for code and different image tags 21 Environments
  • 22. $ git merge dev staging tags $ ansible-playbook deploy.yml staging environment Deploying on staging env
  • 24. - name: Start Backend VM local_action: module: cloudstack_vm name: backendpublic template: "{{ template }}" service_offering: "{{ instance_type }}" security_groups: [ 'backend_public' ] ssh_key: "{{ ssh_key }}" user_data: "{{ lookup('file', '../files/backend_userdata.yml') }}" register: backend_public tags: create_vm Ansible CloudStack module - name: backend SecGroup local_action: module: cloudstack_sg name: database description: Backend public tags: secgroup
  • 25. 25 Ansible Docker module in Ansible core Deploying/Managing containers with Ansible
  • 26. 26 - name: Set Docker login credentials command: docker login -u foobar -e {{hub_email}} --password={{hub_password}} - name: Docker pull sbex/angular-frontend command: docker pull sbex/angular-frontend - name: Start bity docker: image: sbex/angular-frontend detach: true restart_policy: always name: bity ports: 80:80 tags: start_container Ansible docker module
  • 27. 27 Ansible and logdriver - name: Start backend public docker: name: backend image: sbex/backend restart_policy: always volumes: - /app/_env:/usr/src/app/_env:ro detach: true ports: 8000:8000 log_driver: syslog log_opt: syslog-address: udp://{{hostvars['logserver'].ansible_ssh_host}}:5000 syslog-facility: local0 syslog-tag: backendpublic
  • 28. 28 Ansible to configure containers - name: Create directory for settings file: path=/app/_env state=directory - name: Create json settings from template template: src=env.j2 dest=/app/_env/env.json ... - name: Create tables command: docker exec -ti backend ./manage.py migrate
  • 29. 29 Dealing with secrets No secrets in container images Use Ansible vault to encrypt all secrets in playbooks stored in bitbucket $ ansible-vault create /path/to/file.yml $ ansible-vault encrypt /path/to/file.yml $ ansible-vault decrypt /path/to/file.yml $ ansible-vault rekey /path/to/file.yml
  • 30. 30 Container “Orchestration” Every application has its role Several playbooks $ ansible-playbook deploy.yml $ ansible-playbook upgrade.yml $ ansible-playbook stop.yml $ ansible-playbook start.yml
  • 31. 31 Early on: Logspout to ELK Now: Logdriver (ansible 2.0) syslog driver to logstash with ELK Test/deploy monitoring with docker-compose. Logging
  • 32. 32 ElasticSearch 1.7 (+data container) Logstash 1.5.3 (+conf for elk logs) Kibana 4 (+Dashboard for elk logs) cAdvisor (Collect & View containers performance) Ngnix Proxy 1.9.3 (for SSL + password access). One docker-compose runs
  • 33. 33
  • 34. 34 Container restart -> thanks to restart policy (docker > 1.6) Weird Ansible docker behavior at times Config as volume mounts (Too many env variables to handle) Cannot use compose in prod yet (vault, execute commands inside containers ) Lessons Learned
  • 35. 35 Currently using Ubuntu Investigate the use of Docker optimized OS (e.g coreOS, Atomic, RancherOS) Need Easy upgrade of Docker versions With new versions every 2 months, and possible change of recommended storage driver, we need an easy way to cleanly upgrade production systems Investigate the use of a Docker orchestrator, possible replacing Ansible docker module (e.g Swarm, Kubernetes, tutum…) Future