更新时间:2021-06-24 12:36:37
coverpage
Title Page
Copyright and Credits
Hands-On Docker for Microservices with Python
Dedication
About Packt
Why subscribe?
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Code in Action
Conventions used
Get in touch
Reviews
Section 1: Introduction to Microservices
Making the Move – Design Plan and Execute
Technical requirements
The traditional monolith approach and its problems
The characteristics of a microservices approach
Docker containers
Container orchestration and Kubernetes
Parallel deployment and development speed
Challenges and red flags
Analyzing the current system
Preparing and adapting by measuring usage
Strategic planning to break the monolith
The replacement approach
The divide approach
Change and structured approach
Executing the move
Web services' best friend – the load balancer
Keeping the balance between new and old
The pilot phase – setting up the first couple of microservices
The consolidation phase – steady migration to microservices
The final phase – the microservices shop
Summary
Questions
Further reading
Section 2: Designing and Operating a Single Service – Creating a Docker Container
Creating a REST Service with Python
Analyzing the Thoughts Backend microservice
Understanding the security layer
Designing the RESTful API
Specifying the API endpoints
Defining the database schema
Working with SQLAlchemy
Implementing the service
Introducing Flask-RESTPlus
Handling resources
Parsing input parameters
Serializing results
Performing the action
Authenticating the requests
Testing the code
Defining the pytest fixtures
Understanding test_token_validation.py
test_thoughts.py
Build Run and Test Your Service Using Docker
Building your service with a Dockerfile
Executing commands
Understanding the Docker cache
Building a web service container
Configuring uWSGI
Refreshing Docker commands
Operating with an immutable container
Testing the container
Creating a PostgreSQL database container
Configuring your service
Deploying the Docker service locally
Pushing your Docker image to a remote registry
Obtaining public images from Docker Hub
Using tags
Pushing into a registry
Creating a Pipeline and Workflow
Understanding continuous integration practices
Producing automated builds
Knowing the advantages of using Docker for builds
Leveraging the pipeline concept
Branching merging and ensuring a clear main build
Configuring Travis CI
Adding a repo to Travis CI
Creating the .travis.yml file
Working with Travis jobs
Sending notifications