SlideShare a Scribd company logo
How to Deploy Web Apps with Docker
containers!
Workshop Resources!
hands-on lab !
Part 1!
Step1: !
create DigitalOcean account!
!
go to https://cloud.digitalocean.com/registrations/new!
and create a new account!
!
Please use Promo Code: CLOUD66, to receive a $10 Credit. !
Step 2: !
create Cloud 66 account!
!
go to https://app.cloud66.com/users/sign_up!
and create a new account!
Step 3:!
create a remote
development machine!
!
go to https://cloud.digitalocean.com/droplets/new!
use the One-click App tab!
choose Docker 1.10.3 on 14:04
choose size $40/month
region London
press create
you’ll get the login information mailed to you!
!
Step 4:!
log into development
machine!
ssh to your new server
open terminal
use the password in the DigitalOcean email
you will be asked to change your password
$ssh root@<your ip>
Step 5:!
install docker-compose!


output should be : docker-compose version: 1.6.2


$curl -L https://github.com/docker/compose/releases/download/1.6.2/
docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$chmod +x /usr/local/bin/docker-compose
$docker-compose —version
Step 6:!
fork the bakery example
and pull the code!


go to Github.com
fork https://github.com/cloud66-samples/microservices_101
create a a home-directory for the app
pull the code


$mkdir /home/app
$cd /home/app


$git clone https://github.com/<your github account>/microservices_101



go to the bakery/bricksandmortar folder
and change the IP address (of your new server) of the API to be used
Step 6½:!
change the ip!
$vi /home/app/microservices_101/bakery/bricksandmortar/Dockerfile.development


ENV COUNTER_ADDRESS <your ip address>:8000
Step 7:!
build all the images!


$ cd /home/app/microservices_101/bakery


go to the bakery folder
build all the images (takes approx. 10 minutes)


$docker-compose build
Step 8:!
run the application!
!
$docker-compose up -d
Step 9:!
init the datasource with
an on/off command!


create the DB
migrate the DB schema
$docker-compose run counter rake db:create
$docker-compose run counter rake db:migrate
Step 10:!
list all the running containers!
$docker ps
$docker-compose ps

Step 11:!
play with the demo!
!
check docker-compose.yml
to find out on which port the services are running!
https://docs.docker.com/compose/compose-file/!
Step12:!
show the log!
!
see how the requests are coming in !
a great step for debugging!
$docker logs (docker ps for service names)
$docker-compose logs [service_name]

Step 13:!
speedup baking by
scaling the minions!
!
place some order in the bakery shop ;-)!
scale some minions!
!
!
!
!
see how the backing is speed up!
!
$docker-compose scale [minion_service_name]=5
Step 14:!
speedup update by
scaling the counter!
!
$docker-compose scale counter=2
Step 15:!
speedup update by
scaling the counter!
!
lets scale our API!




why does it fail?


$docker-compose scale counter=2
Step 16:!
edit the work time of a minion
(language of choice) and build/
restart!
edit the code and change the minion time
You can edit on your local machine and push the changes to github and pull them into the
remote machine, or edit the code directly on the remote machine.
after editing; rebuild the service
and restart the service


docker-compose will pickup the change


$docker-compose build minion_service_name


$docker-compose up -d minion_service_name
Step 17:!
development of a
service !
stop the service !
go to the source folder of a service!
look at the docker-compose.ml!
we mount the host volume. you can edit and change code and start stop when need!
!
!
!
!
edit the service and just run only the !
!
!
!
(no need for building)!


$docker-compose stop minion_service_name


$docker-compose run minion_service_name
Step 18:!
build/restart service!
done editing and debugging? build the service !
!
!
!
!
run it again!
!


$docker-compose build minion_service_name


$docker-compose up -d minion_service_name
Step 19:!
show memory usage!
!
if you want to see how the memory is getting used:!
run memory usage!
!
!
!
!
!
!
!


$docker stats `docker ps | awk '{print $NF}' | grep -v NAMES`
hands-on lab !
Part 2!
Step 1:!
add DO as your cloud
provider!
!
go to https://app.cloud66.com/clouds and add digital
ocean as the cloud provider!
Step 2:!
create a new Docker
stack!
go to your cloud 66 account and create a Docker stack; give the
stack a name and use the service.yml in .cloud directory from
your repository!
paste the service.yml in the advanced tab and hit NEXT
!
Step 3: choice cloud
provider (DO) and start
deploy!
run on digital ocean using region:
london / 20gb / 2cpu run mysql
and rabbitmq on the same server!
and hit deploy
Step 4:!
explore service.yml
during waiting!
help.cloud66.com/building-your-stack/docker-service-
configuration!
Step 5: !
setup DNS!
check the UI for the new IP address of your docker
cluster.!
edit your /etc/hosts file to point the following URL’s!
[ip_address] www.microservices101.io!
[ip_address] api.microservices101.io!
[ip_address] cms.microservice101.io!
!
!
!
Step 6: !
See you bakery in action!
!
visit www.microservice101.io!
Step 7:!
use Live Logs to see the
logs of the services!
Step 8:!
scale up the minion
process for the UI!
Step 9:!
install cx!
$curl -sSL https://s3.amazonaws.com/downloads.cloud66.com/cx_installation/cx_install.sh | bash


$gcx stacks list



install out CX tool belt
go to your remote development machine (not the one created with C66)
please register the tool belt
check if you can see your new stack




scale a minion
play with scaling others and list all services:


Step 10:!
scale up using CX!
$cx services scale -s [your stack] minion_bagel 5


$cx services list -s [your stack]

Step 11:!
change some code of the
minion and push it to your repo!
Commit your changes and push those changes to github.!
Edit the service.yml to use build grid instead of pulling
images from Docker Hub.!
Build and publish only that service.!

More Related Content

What's hot

Installation of Go Server and Go Agent
Installation of Go Server and Go AgentInstallation of Go Server and Go Agent
Installation of Go Server and Go Agent
vodQA
 
METEOR 101
METEOR 101METEOR 101
METEOR 101
Tin Aung Lin
 
Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017
stevanLM
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
Paul Jensen
 
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
Paul Jensen
 
Deploy Angular to the Cloud (ngBucharest)
Deploy Angular to the Cloud (ngBucharest)Deploy Angular to the Cloud (ngBucharest)
Deploy Angular to the Cloud (ngBucharest)
Simona Cotin
 
Step by step installation domino on docker
Step by step installation domino on dockerStep by step installation domino on docker
Step by step installation domino on docker
Roberto Boccadoro
 
React JS
React JSReact JS
SixFaceCloud Java framework manual
SixFaceCloud Java framework manualSixFaceCloud Java framework manual
SixFaceCloud Java framework manual
SixFaceCloud
 
Using Composer with WordPress - 2.0
Using Composer with WordPress - 2.0Using Composer with WordPress - 2.0
Using Composer with WordPress - 2.0
Micah Wood
 
Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and Silex
Ryan Weaver
 

What's hot (12)

Installation of Go Server and Go Agent
Installation of Go Server and Go AgentInstallation of Go Server and Go Agent
Installation of Go Server and Go Agent
 
METEOR 101
METEOR 101METEOR 101
METEOR 101
 
Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017
 
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and PuppeteerE2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
E2E testing Single Page Apps and APIs with Cucumber.js and Puppeteer
 
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
End to end testing Single Page Apps & APIs with Cucumber.js and Puppeteer (Em...
 
Deploy Angular to the Cloud (ngBucharest)
Deploy Angular to the Cloud (ngBucharest)Deploy Angular to the Cloud (ngBucharest)
Deploy Angular to the Cloud (ngBucharest)
 
Step by step installation domino on docker
Step by step installation domino on dockerStep by step installation domino on docker
Step by step installation domino on docker
 
React JS
React JSReact JS
React JS
 
SixFaceCloud Java framework manual
SixFaceCloud Java framework manualSixFaceCloud Java framework manual
SixFaceCloud Java framework manual
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Using Composer with WordPress - 2.0
Using Composer with WordPress - 2.0Using Composer with WordPress - 2.0
Using Composer with WordPress - 2.0
 
Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and Silex
 

Similar to Cloud66 workshop handouts

Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to Advance
Paras Jain
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentals
Alper Unal
 
Docker Started
Docker StartedDocker Started
Docker Started
Victor S. Recio
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
Ramon Morales
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
GDSC UofT Mississauga
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2
Slobodan Lohja
 
Build, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using DockerBuild, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using Docker
Osama Mustafa
 
Microservices, la risposta che (forse) cercavi!
Microservices, la risposta che (forse) cercavi!Microservices, la risposta che (forse) cercavi!
Microservices, la risposta che (forse) cercavi!
Commit University
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
Michelle Liu
 
Workshop presentation
Workshop presentationWorkshop presentation
Workshop presentation
Cloud 66
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
Dev_Events
 
Deploying an application with Chef and Docker
Deploying an application with Chef and DockerDeploying an application with Chef and Docker
Deploying an application with Chef and Docker
Daniel Ku
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
Suraj Deshmukh
 
Webapp using docker container
Webapp using docker containerWebapp using docker container
Webapp using docker container
SebyAmin
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of Technology
Ajeet Singh Raina
 
A Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using DockerA Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using Docker
Ajeet Singh Raina
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1
Slobodan Lohja
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
Dr. Syed Hassan Amin
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
Container on azure
Container on azureContainer on azure
Container on azure
Vishwas N
 

Similar to Cloud66 workshop handouts (20)

Docker Basic to Advance
Docker Basic to AdvanceDocker Basic to Advance
Docker Basic to Advance
 
Docker fundamentals
Docker fundamentalsDocker fundamentals
Docker fundamentals
 
Docker Started
Docker StartedDocker Started
Docker Started
 
Docker puebla bday #4 celebration
Docker puebla bday #4 celebrationDocker puebla bday #4 celebration
Docker puebla bday #4 celebration
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2
 
Build, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using DockerBuild, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using Docker
 
Microservices, la risposta che (forse) cercavi!
Microservices, la risposta che (forse) cercavi!Microservices, la risposta che (forse) cercavi!
Microservices, la risposta che (forse) cercavi!
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
 
Workshop presentation
Workshop presentationWorkshop presentation
Workshop presentation
 
Containers Lab
Containers Lab Containers Lab
Containers Lab
 
Deploying an application with Chef and Docker
Deploying an application with Chef and DockerDeploying an application with Chef and Docker
Deploying an application with Chef and Docker
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
 
Webapp using docker container
Webapp using docker containerWebapp using docker container
Webapp using docker container
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of Technology
 
A Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using DockerA Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using Docker
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
Introduction to Docker - VIT Campus
Introduction to Docker - VIT CampusIntroduction to Docker - VIT Campus
Introduction to Docker - VIT Campus
 
Container on azure
Container on azureContainer on azure
Container on azure
 

More from Cloud 66

An introduction to Starter (Updated Content)
An introduction to Starter (Updated Content) An introduction to Starter (Updated Content)
An introduction to Starter (Updated Content)
Cloud 66
 
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?
Cloud 66
 
Docker at Digital Ocean
Docker at Digital OceanDocker at Digital Ocean
Docker at Digital Ocean
Cloud 66
 
An introduction to habitus
An introduction to habitusAn introduction to habitus
An introduction to habitus
Cloud 66
 
An introduction to starter
An introduction to starterAn introduction to starter
An introduction to starter
Cloud 66
 
Introduction to the Container Networking and Security
Introduction to the Container Networking and SecurityIntroduction to the Container Networking and Security
Introduction to the Container Networking and Security
Cloud 66
 

More from Cloud 66 (6)

An introduction to Starter (Updated Content)
An introduction to Starter (Updated Content) An introduction to Starter (Updated Content)
An introduction to Starter (Updated Content)
 
How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?How the hell do I run my microservices in production, and will it scale?
How the hell do I run my microservices in production, and will it scale?
 
Docker at Digital Ocean
Docker at Digital OceanDocker at Digital Ocean
Docker at Digital Ocean
 
An introduction to habitus
An introduction to habitusAn introduction to habitus
An introduction to habitus
 
An introduction to starter
An introduction to starterAn introduction to starter
An introduction to starter
 
Introduction to the Container Networking and Security
Introduction to the Container Networking and SecurityIntroduction to the Container Networking and Security
Introduction to the Container Networking and Security
 

Recently uploaded

The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 

Recently uploaded (20)

The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 

Cloud66 workshop handouts

  • 1. How to Deploy Web Apps with Docker containers! Workshop Resources!
  • 3. Step1: ! create DigitalOcean account! ! go to https://cloud.digitalocean.com/registrations/new! and create a new account! ! Please use Promo Code: CLOUD66, to receive a $10 Credit. !
  • 4. Step 2: ! create Cloud 66 account! ! go to https://app.cloud66.com/users/sign_up! and create a new account!
  • 5. Step 3:! create a remote development machine! ! go to https://cloud.digitalocean.com/droplets/new! use the One-click App tab! choose Docker 1.10.3 on 14:04 choose size $40/month region London press create you’ll get the login information mailed to you! !
  • 6. Step 4:! log into development machine! ssh to your new server open terminal use the password in the DigitalOcean email you will be asked to change your password $ssh root@<your ip>
  • 7. Step 5:! install docker-compose! 
 output should be : docker-compose version: 1.6.2 
 $curl -L https://github.com/docker/compose/releases/download/1.6.2/ docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose $chmod +x /usr/local/bin/docker-compose $docker-compose —version
  • 8. Step 6:! fork the bakery example and pull the code! 
 go to Github.com fork https://github.com/cloud66-samples/microservices_101 create a a home-directory for the app pull the code 
 $mkdir /home/app $cd /home/app 
 $git clone https://github.com/<your github account>/microservices_101

  • 9. 
 go to the bakery/bricksandmortar folder and change the IP address (of your new server) of the API to be used Step 6½:! change the ip! $vi /home/app/microservices_101/bakery/bricksandmortar/Dockerfile.development 
 ENV COUNTER_ADDRESS <your ip address>:8000
  • 10. Step 7:! build all the images! 
 $ cd /home/app/microservices_101/bakery 
 go to the bakery folder build all the images (takes approx. 10 minutes) 
 $docker-compose build
  • 11. Step 8:! run the application! ! $docker-compose up -d
  • 12. Step 9:! init the datasource with an on/off command! 
 create the DB migrate the DB schema $docker-compose run counter rake db:create $docker-compose run counter rake db:migrate
  • 13. Step 10:! list all the running containers! $docker ps $docker-compose ps

  • 14. Step 11:! play with the demo! ! check docker-compose.yml to find out on which port the services are running! https://docs.docker.com/compose/compose-file/!
  • 15. Step12:! show the log! ! see how the requests are coming in ! a great step for debugging! $docker logs (docker ps for service names) $docker-compose logs [service_name]

  • 16. Step 13:! speedup baking by scaling the minions! ! place some order in the bakery shop ;-)! scale some minions! ! ! ! ! see how the backing is speed up! ! $docker-compose scale [minion_service_name]=5
  • 17. Step 14:! speedup update by scaling the counter! ! $docker-compose scale counter=2
  • 18. Step 15:! speedup update by scaling the counter! ! lets scale our API! 
 
 why does it fail? 
 $docker-compose scale counter=2
  • 19. Step 16:! edit the work time of a minion (language of choice) and build/ restart! edit the code and change the minion time You can edit on your local machine and push the changes to github and pull them into the remote machine, or edit the code directly on the remote machine. after editing; rebuild the service and restart the service 
 docker-compose will pickup the change 
 $docker-compose build minion_service_name 
 $docker-compose up -d minion_service_name
  • 20. Step 17:! development of a service ! stop the service ! go to the source folder of a service! look at the docker-compose.ml! we mount the host volume. you can edit and change code and start stop when need! ! ! ! ! edit the service and just run only the ! ! ! ! (no need for building)! 
 $docker-compose stop minion_service_name 
 $docker-compose run minion_service_name
  • 21. Step 18:! build/restart service! done editing and debugging? build the service ! ! ! ! ! run it again! ! 
 $docker-compose build minion_service_name 
 $docker-compose up -d minion_service_name
  • 22. Step 19:! show memory usage! ! if you want to see how the memory is getting used:! run memory usage! ! ! ! ! ! ! ! 
 $docker stats `docker ps | awk '{print $NF}' | grep -v NAMES`
  • 24. Step 1:! add DO as your cloud provider! ! go to https://app.cloud66.com/clouds and add digital ocean as the cloud provider!
  • 25. Step 2:! create a new Docker stack! go to your cloud 66 account and create a Docker stack; give the stack a name and use the service.yml in .cloud directory from your repository! paste the service.yml in the advanced tab and hit NEXT !
  • 26. Step 3: choice cloud provider (DO) and start deploy! run on digital ocean using region: london / 20gb / 2cpu run mysql and rabbitmq on the same server! and hit deploy
  • 27. Step 4:! explore service.yml during waiting! help.cloud66.com/building-your-stack/docker-service- configuration!
  • 28. Step 5: ! setup DNS! check the UI for the new IP address of your docker cluster.! edit your /etc/hosts file to point the following URL’s! [ip_address] www.microservices101.io! [ip_address] api.microservices101.io! [ip_address] cms.microservice101.io! ! ! !
  • 29. Step 6: ! See you bakery in action! ! visit www.microservice101.io!
  • 30. Step 7:! use Live Logs to see the logs of the services!
  • 31. Step 8:! scale up the minion process for the UI!
  • 32. Step 9:! install cx! $curl -sSL https://s3.amazonaws.com/downloads.cloud66.com/cx_installation/cx_install.sh | bash 
 $gcx stacks list
 
 install out CX tool belt go to your remote development machine (not the one created with C66) please register the tool belt check if you can see your new stack 

  • 33. 
 scale a minion play with scaling others and list all services: 
 Step 10:! scale up using CX! $cx services scale -s [your stack] minion_bagel 5 
 $cx services list -s [your stack]

  • 34. Step 11:! change some code of the minion and push it to your repo! Commit your changes and push those changes to github.! Edit the service.yml to use build grid instead of pulling images from Docker Hub.! Build and publish only that service.!