Deployment releases a software system from a local experiment into a reachable, repeatable production service. A chatbot that once ran as one process with local storage must withstand bursts, replacement instances, secrets management, and real users. section 5.0
A production-ready deployment keeps service instances stateless, moves configuration into environment variables, packages the application in a Docker image, and runs it on a managed container host. The image should boot consistently on a developer laptop, Azure App Service, or another supported host. section 5.0
A repeatable deployment workflow typically includes:
- Package the application and its dependencies into a self-contained Docker image. section 5.0
- Store the image in a registry so the host pulls an immutable artifact rather than a developer's local state. section 5.2
- Keep credentials in Azure configuration and GitHub encrypted secrets instead of embedding them in the image or source tree. section 5.2 section 5.2.4
- Use GitHub Actions to build, test, and deploy after commits, blocking releases when tests fail. section 5.2.4 section 5.3
- Validate the public endpoint, inspect live logs, and load-test with Locust before scaling resources or replicas. section 5.0 section 5.3
Verifying a deployed WebSocket service
Copy the Azure App Service domain into a browser harness, change the connection to wss://, submit a prompt, and inspect Log stream for “Listening on port 8000.” A streamed response confirms that external traffic reaches the packaged Python process. section 5.3
Figure 5.1 This flowchart shows the key stages of this chapter. We will start by packaging our app as a container, then deploy it to Azure’s app service, then test it remotely. Finally, we will perform load testing using logging and simulated users with Locust.
Use the deployment flow to navigate from container packaging through Azure hosting, remote testing, logging, and Locust-based load testing. section 5.0




























