
- 250 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Docker for Serverless Applications
About this book
Build applications and infrastructures that leverage Function-as-a-Service and DockerAbout This Book• Implement containerization in Serverless/FaaS environments• Utilize Docker as a functional unit of work for Serverless/FaaS platforms• Use Docker as a portable infrastructure for Serverless ApplicationsWho This Book Is ForIf you are a Developer, a Docker Engineer, a DevOps Engineer, or any stakeholder interested in learning the use of Docker on Serverless environments then this book is for you.What You Will Learn• Learn what Serverless and FaaS applications are• Get acquainted with the architectures of three major serverless systems• Explore how Docker technologies can help develop Serverless applications• Create and maintain FaaS infrastructures• Set up Docker infrastructures to serve as on-premises FaaS infrastructures• Define functions for Serverless applications with Docker containersIn DetailServerless applications have gained a lot of popularity among developers and are currently the buzzwords in the tech market. Docker and serverless are two terms that go hand-in-hand.This book will start by explaining serverless and Function-as-a-Service (FaaS) concepts, and why they are important. Then, it will introduce the concepts of containerization and how Docker fits into the Serverless ideology. It will explore the architectures and components of three major Docker-based FaaS platforms, how to deploy and how to use their CLI. Then, this book will discuss how to set up and operate a production-grade Docker cluster. We will cover all concepts of FaaS frameworks with practical use cases, followed by deploying and orchestrating these serverless systems using Docker. Finally, we will also explore advanced topics and prototypes for FaaS architectures in the last chapter.By the end of this book, you will be in a position to build and deploy your own FaaS platform using Docker.Style and approachA practical guide that offers a simple way to easily understand Serverless Applications utilizing Docker as the development environment.
Frequently asked questions
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Information
Putting Them All Together
- A mobile payment scenario
- A Parse platform as a backend
- Preparing a WebHook in Fn
- An event state machine with a blockchain
- Wrapping a legacy with a function
- Using a function as a Glue
- A stream processor
- Inter-FaaS platform networking
A mobile payment scenario

- The Parse platform, as a backend for the UI.
- The Bank Routing function. It is written in Java and deployed on Fn. This component is called routing_fn.
- Bank #1 and its function calling to a legacy web-based system. The function here is written in Node.js using the chromeless library (https://github.com/graphcool/chromeless). The function connects to a headless Chrome instance, our familiar web browser. The function drives Chrome to navigate and create a transaction for us on a real ERP system. We use Moqui as our ERP backend. Actually, Moqui comes with a complete set of REST APIs, but we intentionally use its web base to simulate the scenario where we need to modernize some legacy systems. The function of this part is called hivectl.
- Bank #2 and its function, account_ctl, connecting to a REST-based bank system. The function is written using Go and will be running on OpenWhisk. The mock bank server behind this component is a simple one written using the Grails/Spring Boot framework. We use this component to demonstrate how to write a FaaS function to wrap and simplify a REST-based API. The Bank Routing function, routing_fn, will be selectively called by each bank. This Bank #2 component will be used together with Bank #1 there.
- A set of smart contracts written in Solidity to maintain the mapping of mobile numbers to bank accounts. Also, another set of smart contracts will be used to maintain the state of the money transfer of each transaction.
- An agent written in Java and the RxJava library to demonstrate a data stream processing component that calls a function and diverts the event to other parts of the system.
A Parse platform as a backend
Preparation
$ docker network create \
--driver=weaveworks/net-plugin:2.1.3 \
--subnet=10.32.2.0/24 \
--attachable \
parse_net
$ docker volume create mongo_data
$ docker stack deploy -c mongodb.yml parse_01
$ docker stack deploy -c parse.yml parse_02
$ docker stack deploy -c parse_dashboard.yml parse_03
$ docker stack deploy -c ingress.yml parse_04
version: '3.3'
services:
mongo:
image: mongo:3.6.1-jessie
volumes:
- mongo_data:/data/db
volumes:
mongo_data:
external: true
networks:
default:
external:
name: parse_net
version: '3.3'
services:
parse_server:
image: parseplatform/parse-server:2.6.5
command: --appId APP1 --masterKey MASTER_KEY --databaseURI mongodb://mongo/prod
deploy:
labels:
- "traefik.docker.network=parse_net"
- "traefik.port=1337"
- "traefik.frontend.rule=Method: GET,POST,PUT,DELETE,OPTIONS,HEAD,CONNECT"
- "traefik.frontend.entryPoints=parse_server"
- "traefik.frontend.headers.customresponseheaders.Access-Control-Allow-Origin=*"
networks:
default:
external:
name: parse_net
version: '3.3'
services:
parse_dashboard:
image: parseplatform/parse-dashboard:1.1.2
environ...
Table of contents
- Title Page
- Copyright and Credits
- Packt Upsell
- Contributors
- Preface
- Serverless and Docker
- Docker and Swarm Clusters
- Serverless Frameworks
- OpenFaaS on Docker
- The Fn Project
- OpenWhisk on Docker
- Operating FaaS Clusters
- Putting Them All Together
- The Future of Serverless
- Other Books You May Enjoy