SlideShare a Scribd company logo
1 of 12
Download to read offline
INTRODUCTION
INTRODUCTION
PROMISES
▸ isolation
▸ lightness
▸ repeatability
▸ speed
▸ easy collaboration
▸ easy configuration
INTRODUCTION
WHY DOCKER?
INTRODUCTION
TECHNOLOGIES
▸ LXC - Linux Containers - process
isolation
▸ UnionFS - layered file system
▸ Go - programming language
LINUX
UNION FS LXC
DOCKER (GO)
▸ container - run
▸ image - build
▸ registry - pull/push
INTRODUCTION
TERMS AND OPERATIONS
EXAMPLE
MINECRAFT SERVER
# Minecraft 1.8.7 Dockerfile - Example with notes
# Use the offical Debian Docker image with a specified version tag, Wheezy, so
not all
# versions of Debian images are downloaded.
FROM debian:wheezy
# Use APT (Advanced Packaging Tool) built in the Linux distro to download Java, a
dependency to run Minecraft.
RUN apt-get -y update
RUN apt-get -y install openjdk-7-jre-headless wget
# Download Minecraft Server components
RUN wget -q https://s3.amazonaws.com/Minecraft.Download/versions/1.9.2/
minecraft_server.1.9.2.jar
# Sets working directory for the CMD instruction (also works for RUN, ENTRYPOINT
commands)
# Create mount point, and mark it as holding externally mounted volume
WORKDIR /data
VOLUME /data
# Expose the container's network port: 25565 during runtime.
EXPOSE 25565
#Automatically accept Minecraft EULA, and start Minecraft server
CMD echo eula=true > /data/eula.txt && java -jar /minecraft_server.1.9.2.jar
DEMO
JUMP AT THE DEEP END
DEMO
WHAT’S THE GOAL
▸ bpasik’s Node.js app with Mongo DB running on Docker

https://github.com/Gustu/Node-Asynchronous-Examples
TOOLS REFERENCE
▸ Docker hub

https://hub.docker.com/_/node

https://hub.docker.com/_/mongo/
▸ Dockerfile

https://docs.docker.com/engine/reference/builder/
▸ Docker compose

https://docs.docker.com/compose/

DEMO
BUILD IT
# Dockerfile
FROM node:onbuild
EXPOSE 3000
RUN IT
# run mongo as daemon container and expose it’s 27017 port to localhost’s 27017
# WARNING: on Windows or OS X Docker is not running on localhost
# it’s running on boot2docker VM with it’s own IP
# so it’s exposing this port as e.g. 192.169.99.100:27017
# (this also means you’d have to embed this IP into config/default.json)
$ docker run -d -p 27017:27017 mongo
<< mongo container id here>>
# build our app Docker image and tag it as node-app
$ docker build -t node-app .
<< lots of logs here >>
# run mongo as daemon and expose container’s port 3000 to localhost’s 3000
$ docker run -d -p 3000:3000 node-app
<< node-app container id here>>
# you can now access localhost:3000 and see the running containers
$ docker ps
DEMO
BUT RUNNING IT BY HAND EACH TIME IS UNCOOL…
# WARNING: remove all containers (running and stopped)
$ docker ps -qa | xargs docker rm -f
Cleanup
Declarative docker compose configuration
# docker-compose.yml
version: '2'
services:
web:
# use our Dockerfile
build: .
# expose the port 3000
ports:
- "3000:3000"
links:
# link the mongo container under hostname 'mongo'
# remember to change config/default.json to use mongo:27017
- mongo
mongo:
image: mongo
$ docker-compose up
# try changing public/index.html and refresh the page
Run it!
DEMO
WHAT IF WE WANT TO EDIT LIVE FILES?
$ docker-compose down
Cleanup (the docker-compose way)
Change our Dockerfile to use other base image
# Dockerfile
FROM node
EXPOSE 3000
# point to our volume (where the app is mounted)
WORKDIR /app
# start with the app’s start command
CMD [ "npm", "start" ]
$ docker-compose up
# try changing public/index.html again and see the changes live
Run it!
Change our docker-compose.yml to use a volume
version: '2'
services:
web:
build: .
ports:
- "3000:3000"
# mount . directory to container’s /app
volumes:
- .:/app
links:
- mongo
mongo:
image: mongo
DEMO
SUMMING UP
▸ we’ve started from running containers by hand
▸ defined Docker compose config with linked containers
▸ changed the app embedded in the image to be mounted
as a volume
▸ Dockerization available in my fork of the app:

https://github.com/tcichowicz/Node-Asynchronous-
Examples

More Related Content

What's hot

Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Binary Studio
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Pini Reznik
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersSagar Acharya
 
How to manage Microsoft Azure with open source
How to manage Microsoft Azure with open sourceHow to manage Microsoft Azure with open source
How to manage Microsoft Azure with open sourceTaehee Jang
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Binary Studio
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyAndré Rømcke
 
Webapp using docker container
Webapp using docker containerWebapp using docker container
Webapp using docker containerSebyAmin
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDegendra Sivakoti
 
Docker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker RegistryDocker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker RegistryMario IC
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesLuciano Fiandesio
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Bill Maxwell
 
First steps to docker
First steps to dockerFirst steps to docker
First steps to dockerGuilhem Marty
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-containerNaoya Hashimoto
 
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
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Binary Studio
 

What's hot (20)

CoreOS Overview
CoreOS OverviewCoreOS Overview
CoreOS Overview
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
 
How to manage Microsoft Azure with open source
How to manage Microsoft Azure with open sourceHow to manage Microsoft Azure with open source
How to manage Microsoft Azure with open source
 
Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3Academy PRO: Docker. Lecture 3
Academy PRO: Docker. Lecture 3
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
Webapp using docker container
Webapp using docker containerWebapp using docker container
Webapp using docker container
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deployment
 
Docker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker RegistryDocker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker Registry
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101
 
First steps to docker
First steps to dockerFirst steps to docker
First steps to docker
 
Container sig#1 ansible-container
Container sig#1 ansible-containerContainer sig#1 ansible-container
Container sig#1 ansible-container
 
Docker Workshop
Docker WorkshopDocker Workshop
Docker Workshop
 
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
 
Docker
DockerDocker
Docker
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4Academy PRO: Docker. Lecture 4
Academy PRO: Docker. Lecture 4
 

Viewers also liked

Herramientas digitales para la educación
Herramientas digitales para la educación Herramientas digitales para la educación
Herramientas digitales para la educación Evelyn Barra
 
A poesia das irmandades da fala. caracteristicas autores e obras
A poesia das irmandades da fala. caracteristicas autores e obrasA poesia das irmandades da fala. caracteristicas autores e obras
A poesia das irmandades da fala. caracteristicas autores e obrasVíctor Agrasar Salegui
 
China house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnes
China house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnesChina house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnes
China house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnesJeroen Vinkesteijn
 
El contencioso tributario en venezuela
El contencioso tributario en venezuelaEl contencioso tributario en venezuela
El contencioso tributario en venezuelaCaribay Segura Rios
 
Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017
Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017
Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017Federica Segalini
 
Community engagement for maternal health: lessons learned from southern Ethio...
Community engagement for maternal health: lessons learned from southern Ethio...Community engagement for maternal health: lessons learned from southern Ethio...
Community engagement for maternal health: lessons learned from southern Ethio...REACHOUTCONSORTIUMSLIDES
 
El contencioso tributario
El contencioso tributarioEl contencioso tributario
El contencioso tributarioAlibeth Maduro
 
Taller 1 tics
Taller 1 ticsTaller 1 tics
Taller 1 ticsmilena8a
 

Viewers also liked (17)

Dockers zero to hero
Dockers zero to heroDockers zero to hero
Dockers zero to hero
 
Herramientas digitales para la educación
Herramientas digitales para la educación Herramientas digitales para la educación
Herramientas digitales para la educación
 
A poesia das irmandades da fala. caracteristicas autores e obras
A poesia das irmandades da fala. caracteristicas autores e obrasA poesia das irmandades da fala. caracteristicas autores e obras
A poesia das irmandades da fala. caracteristicas autores e obras
 
China house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnes
China house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnesChina house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnes
China house NHTV Meet-up 4 Jessica Sun China Talk on cultural differecnes
 
El contencioso tributario en venezuela
El contencioso tributario en venezuelaEl contencioso tributario en venezuela
El contencioso tributario en venezuela
 
A poesía das irmandades da fala
A poesía das irmandades da falaA poesía das irmandades da fala
A poesía das irmandades da fala
 
Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017
Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017
Federica Segalini - Rosa Digitale, Latina 27 gennaio 2017
 
Community engagement for maternal health: lessons learned from southern Ethio...
Community engagement for maternal health: lessons learned from southern Ethio...Community engagement for maternal health: lessons learned from southern Ethio...
Community engagement for maternal health: lessons learned from southern Ethio...
 
El contencioso tributario
El contencioso tributarioEl contencioso tributario
El contencioso tributario
 
Sequence1
Sequence1Sequence1
Sequence1
 
castellano
castellanocastellano
castellano
 
Signos de puntuacion
Signos de puntuacion Signos de puntuacion
Signos de puntuacion
 
Question 2
Question 2 Question 2
Question 2
 
Taller 1 tics
Taller 1 ticsTaller 1 tics
Taller 1 tics
 
109580737 introduction-darul-uloom-karachi
109580737 introduction-darul-uloom-karachi109580737 introduction-darul-uloom-karachi
109580737 introduction-darul-uloom-karachi
 
Ծիածան
ԾիածանԾիածան
Ծիածան
 
10 Ways to Win Tenders
10 Ways to Win Tenders 10 Ways to Win Tenders
10 Ways to Win Tenders
 

Similar to Run a Node.js app with Mongo DB using Docker

Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruSwaminathan Vetri
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Alessandro Mignogna
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandPRIYADARSHINI ANAND
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Developmentmsyukor
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020CloudHero
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peekmsyukor
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Dockermsyukor
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇Philip Zheng
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
 

Similar to Run a Node.js app with Mongo DB using Docker (20)

Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Docker
DockerDocker
Docker
 
Dockerized maven
Dockerized mavenDockerized maven
Dockerized maven
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
 
Docker
DockerDocker
Docker
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps DevelopmentDocker: A New Way to Turbocharging Your Apps Development
Docker: A New Way to Turbocharging Your Apps Development
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Containerizing Web Application with Docker
Containerizing Web Application with DockerContainerizing Web Application with Docker
Containerizing Web Application with Docker
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Docker intro
Docker introDocker intro
Docker intro
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Docker containers on Windows
Docker containers on WindowsDocker containers on Windows
Docker containers on Windows
 
How to _docker
How to _dockerHow to _docker
How to _docker
 

More from Espeo Software

Distributed, immutable, secure...
Distributed, immutable, secure...Distributed, immutable, secure...
Distributed, immutable, secure...Espeo Software
 
Initial Coin Offerings – legal requirements and types of tokens
Initial Coin Offerings – legal requirements and types of tokensInitial Coin Offerings – legal requirements and types of tokens
Initial Coin Offerings – legal requirements and types of tokensEspeo Software
 
Trustless off chain computing on the blockchain
Trustless off chain computing on the blockchainTrustless off chain computing on the blockchain
Trustless off chain computing on the blockchainEspeo Software
 
How to sell your business idea to your customers & investors
How to sell your business idea to your customers & investorsHow to sell your business idea to your customers & investors
How to sell your business idea to your customers & investorsEspeo Software
 
How to build a coin and start an ICO
How to build a coin and start an ICOHow to build a coin and start an ICO
How to build a coin and start an ICOEspeo Software
 
How to scale your tech startup for the win
How to scale your tech startup for the winHow to scale your tech startup for the win
How to scale your tech startup for the winEspeo Software
 
Before You Start Outsourcing Software Development [Checklist]
Before You Start Outsourcing Software Development [Checklist]Before You Start Outsourcing Software Development [Checklist]
Before You Start Outsourcing Software Development [Checklist]Espeo Software
 
What Should a Good Code Review Check?
What Should a Good Code Review Check?What Should a Good Code Review Check?
What Should a Good Code Review Check?Espeo Software
 
Espeo's looking for a DevOps Engineer!
Espeo's looking for a DevOps Engineer!Espeo's looking for a DevOps Engineer!
Espeo's looking for a DevOps Engineer!Espeo Software
 
Software Team Efficiency: Velocity
Software Team Efficiency: VelocitySoftware Team Efficiency: Velocity
Software Team Efficiency: VelocityEspeo Software
 
Introduction to Scrum: A How-To Guide
Introduction to Scrum: A How-To GuideIntroduction to Scrum: A How-To Guide
Introduction to Scrum: A How-To GuideEspeo Software
 
To Hire or Not to Hire: In-house vs. Offshore Development
To Hire or Not to Hire: In-house vs. Offshore DevelopmentTo Hire or Not to Hire: In-house vs. Offshore Development
To Hire or Not to Hire: In-house vs. Offshore DevelopmentEspeo Software
 
Web Application Performance for Business Success
Web Application Performance for Business SuccessWeb Application Performance for Business Success
Web Application Performance for Business SuccessEspeo Software
 
Guide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedGuide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedEspeo Software
 
Big Data Ecosystem - 1000 Simulated Drones
Big Data Ecosystem - 1000 Simulated DronesBig Data Ecosystem - 1000 Simulated Drones
Big Data Ecosystem - 1000 Simulated DronesEspeo Software
 
Azure Machine Learning
Azure Machine LearningAzure Machine Learning
Azure Machine LearningEspeo Software
 
Report: Wearables in Healthcare
Report: Wearables in HealthcareReport: Wearables in Healthcare
Report: Wearables in HealthcareEspeo Software
 
Industrial Internet Solutions for Manufacturing & Logistics
Industrial Internet Solutions for Manufacturing & LogisticsIndustrial Internet Solutions for Manufacturing & Logistics
Industrial Internet Solutions for Manufacturing & LogisticsEspeo Software
 
Big Data - Why is it important for business?
Big Data - Why is it important for business?Big Data - Why is it important for business?
Big Data - Why is it important for business?Espeo Software
 
A Future for Digital Health Wearables
A Future for Digital Health WearablesA Future for Digital Health Wearables
A Future for Digital Health WearablesEspeo Software
 

More from Espeo Software (20)

Distributed, immutable, secure...
Distributed, immutable, secure...Distributed, immutable, secure...
Distributed, immutable, secure...
 
Initial Coin Offerings – legal requirements and types of tokens
Initial Coin Offerings – legal requirements and types of tokensInitial Coin Offerings – legal requirements and types of tokens
Initial Coin Offerings – legal requirements and types of tokens
 
Trustless off chain computing on the blockchain
Trustless off chain computing on the blockchainTrustless off chain computing on the blockchain
Trustless off chain computing on the blockchain
 
How to sell your business idea to your customers & investors
How to sell your business idea to your customers & investorsHow to sell your business idea to your customers & investors
How to sell your business idea to your customers & investors
 
How to build a coin and start an ICO
How to build a coin and start an ICOHow to build a coin and start an ICO
How to build a coin and start an ICO
 
How to scale your tech startup for the win
How to scale your tech startup for the winHow to scale your tech startup for the win
How to scale your tech startup for the win
 
Before You Start Outsourcing Software Development [Checklist]
Before You Start Outsourcing Software Development [Checklist]Before You Start Outsourcing Software Development [Checklist]
Before You Start Outsourcing Software Development [Checklist]
 
What Should a Good Code Review Check?
What Should a Good Code Review Check?What Should a Good Code Review Check?
What Should a Good Code Review Check?
 
Espeo's looking for a DevOps Engineer!
Espeo's looking for a DevOps Engineer!Espeo's looking for a DevOps Engineer!
Espeo's looking for a DevOps Engineer!
 
Software Team Efficiency: Velocity
Software Team Efficiency: VelocitySoftware Team Efficiency: Velocity
Software Team Efficiency: Velocity
 
Introduction to Scrum: A How-To Guide
Introduction to Scrum: A How-To GuideIntroduction to Scrum: A How-To Guide
Introduction to Scrum: A How-To Guide
 
To Hire or Not to Hire: In-house vs. Offshore Development
To Hire or Not to Hire: In-house vs. Offshore DevelopmentTo Hire or Not to Hire: In-house vs. Offshore Development
To Hire or Not to Hire: In-house vs. Offshore Development
 
Web Application Performance for Business Success
Web Application Performance for Business SuccessWeb Application Performance for Business Success
Web Application Performance for Business Success
 
Guide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedGuide to Node.js: Basic to Advanced
Guide to Node.js: Basic to Advanced
 
Big Data Ecosystem - 1000 Simulated Drones
Big Data Ecosystem - 1000 Simulated DronesBig Data Ecosystem - 1000 Simulated Drones
Big Data Ecosystem - 1000 Simulated Drones
 
Azure Machine Learning
Azure Machine LearningAzure Machine Learning
Azure Machine Learning
 
Report: Wearables in Healthcare
Report: Wearables in HealthcareReport: Wearables in Healthcare
Report: Wearables in Healthcare
 
Industrial Internet Solutions for Manufacturing & Logistics
Industrial Internet Solutions for Manufacturing & LogisticsIndustrial Internet Solutions for Manufacturing & Logistics
Industrial Internet Solutions for Manufacturing & Logistics
 
Big Data - Why is it important for business?
Big Data - Why is it important for business?Big Data - Why is it important for business?
Big Data - Why is it important for business?
 
A Future for Digital Health Wearables
A Future for Digital Health WearablesA Future for Digital Health Wearables
A Future for Digital Health Wearables
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Run a Node.js app with Mongo DB using Docker

  • 2. INTRODUCTION PROMISES ▸ isolation ▸ lightness ▸ repeatability ▸ speed ▸ easy collaboration ▸ easy configuration
  • 4. INTRODUCTION TECHNOLOGIES ▸ LXC - Linux Containers - process isolation ▸ UnionFS - layered file system ▸ Go - programming language LINUX UNION FS LXC DOCKER (GO)
  • 5. ▸ container - run ▸ image - build ▸ registry - pull/push INTRODUCTION TERMS AND OPERATIONS
  • 6. EXAMPLE MINECRAFT SERVER # Minecraft 1.8.7 Dockerfile - Example with notes # Use the offical Debian Docker image with a specified version tag, Wheezy, so not all # versions of Debian images are downloaded. FROM debian:wheezy # Use APT (Advanced Packaging Tool) built in the Linux distro to download Java, a dependency to run Minecraft. RUN apt-get -y update RUN apt-get -y install openjdk-7-jre-headless wget # Download Minecraft Server components RUN wget -q https://s3.amazonaws.com/Minecraft.Download/versions/1.9.2/ minecraft_server.1.9.2.jar # Sets working directory for the CMD instruction (also works for RUN, ENTRYPOINT commands) # Create mount point, and mark it as holding externally mounted volume WORKDIR /data VOLUME /data # Expose the container's network port: 25565 during runtime. EXPOSE 25565 #Automatically accept Minecraft EULA, and start Minecraft server CMD echo eula=true > /data/eula.txt && java -jar /minecraft_server.1.9.2.jar
  • 7. DEMO JUMP AT THE DEEP END
  • 8. DEMO WHAT’S THE GOAL ▸ bpasik’s Node.js app with Mongo DB running on Docker
 https://github.com/Gustu/Node-Asynchronous-Examples TOOLS REFERENCE ▸ Docker hub
 https://hub.docker.com/_/node
 https://hub.docker.com/_/mongo/ ▸ Dockerfile
 https://docs.docker.com/engine/reference/builder/ ▸ Docker compose
 https://docs.docker.com/compose/

  • 9. DEMO BUILD IT # Dockerfile FROM node:onbuild EXPOSE 3000 RUN IT # run mongo as daemon container and expose it’s 27017 port to localhost’s 27017 # WARNING: on Windows or OS X Docker is not running on localhost # it’s running on boot2docker VM with it’s own IP # so it’s exposing this port as e.g. 192.169.99.100:27017 # (this also means you’d have to embed this IP into config/default.json) $ docker run -d -p 27017:27017 mongo << mongo container id here>> # build our app Docker image and tag it as node-app $ docker build -t node-app . << lots of logs here >> # run mongo as daemon and expose container’s port 3000 to localhost’s 3000 $ docker run -d -p 3000:3000 node-app << node-app container id here>> # you can now access localhost:3000 and see the running containers $ docker ps
  • 10. DEMO BUT RUNNING IT BY HAND EACH TIME IS UNCOOL… # WARNING: remove all containers (running and stopped) $ docker ps -qa | xargs docker rm -f Cleanup Declarative docker compose configuration # docker-compose.yml version: '2' services: web: # use our Dockerfile build: . # expose the port 3000 ports: - "3000:3000" links: # link the mongo container under hostname 'mongo' # remember to change config/default.json to use mongo:27017 - mongo mongo: image: mongo $ docker-compose up # try changing public/index.html and refresh the page Run it!
  • 11. DEMO WHAT IF WE WANT TO EDIT LIVE FILES? $ docker-compose down Cleanup (the docker-compose way) Change our Dockerfile to use other base image # Dockerfile FROM node EXPOSE 3000 # point to our volume (where the app is mounted) WORKDIR /app # start with the app’s start command CMD [ "npm", "start" ] $ docker-compose up # try changing public/index.html again and see the changes live Run it! Change our docker-compose.yml to use a volume version: '2' services: web: build: . ports: - "3000:3000" # mount . directory to container’s /app volumes: - .:/app links: - mongo mongo: image: mongo
  • 12. DEMO SUMMING UP ▸ we’ve started from running containers by hand ▸ defined Docker compose config with linked containers ▸ changed the app embedded in the image to be mounted as a volume ▸ Dockerization available in my fork of the app:
 https://github.com/tcichowicz/Node-Asynchronous- Examples