
We’re excited to announce a major enhancement to our WebStencils demo project: native Docker support! This new feature opens up exciting possibilities for deploying and distributing your Delphi web applications built with WebStencils and WebBroker.
Table of Contents
Expanding Deployment Horizons
Delphi has always been known for creating powerful, efficient applications. Now we’re taking that strength into the modern containerized world, where applications can be deployed consistently across any environment. Docker support brings new opportunities to reach broader audiences and use modern deployment practices that are changing how applications are delivered and managed.
What is Docker? (A Quick Introduction)
If you’re new to Docker, think of it as a “shipping container” for your applications. Just like how shipping containers revolutionized global trade by standardizing how goods are transported, Docker standardizes how applications are packaged and deployed.
Key benefits of Docker:
- Consistency: Your app runs the same way everywhere – development, testing, and production
- Isolation: Each application runs separately, preventing conflicts
- Portability: Build once, run anywhere – Windows, Linux, cloud platforms
- Scalability: Easy to deploy multiple instances of your application
- Version Control: Each container version is locked in, making rollbacks simple
Introducing Docker Integration in WebStencils Demo
Our WebStencils demo now includes a complete Docker workflow that integrates with Delphi’s build system. The main piece is a new build configuration called “Docker” that orchestrates the entire containerization process automatically using WSL and a PowerShell script in a post-build event.
One-Click Docker Build
The demo project now includes a new build configuration called “Docker” that automatically:
- Builds your Delphi application for Linux
- Creates a Docker image with all necessary dependencies
- Sets up proper file permissions and directory structure
- Includes automatic database initialization
- Configures logging and health monitoring
How It Works
The process is very simple:
- Select the Docker build configuration in Delphi (Release → Docker with Linux platform)
- Build your project (Ctrl+Shift+F9)
- Run the container with a single command
- Access your application at http://localhost:8080
Behind the scenes, our PowerShell script (build_docker_image.ps1) handles all the complexity, including cleaning up old containers and images, creating a temporary build context, copying the Linux executable and resources, setting proper file permissions, building the Docker image, and removing temporary files. For more detailed information, check the README.md file included with the project.
Persistent Data Management
The Docker setup follows best practices for data persistence through Docker volumes or path binding. You can mount host directories for logs and data, ensuring your application information survives container restarts and updates:
1 2 3 4 5 |
docker run -d -p 8080:8080 -v /host/path/to/logs:/app/logs -v /host/path/to/data:/app/data --name=webstencils-demo webstencils-demo:latest |
Getting Started
To try the new Docker feature:
Prerequisites: Ensure you have WSL2 and Docker CLI installed
Download: Get the latest WebStencils demo from our repository
Build: Use the Docker build configuration in Delphi
Run: Execute the Docker run command
Explore: Access the demo at http://localhost:8080
The demo includes all the existing features that were already available:
- Documentation: Built-in WebStencils documentation
- Big Table Demo: 1000 customers with FireDAC
- Pagination Demo: Server-side pagination example
- To-Do App: HTMX integration with dynamic updates
Wrapping Up
Docker support represents a significant step forward for Delphi web development. It bridges the gap between traditional desktop application deployment and modern web application practices, making Delphi applications more accessible to a broader range of deployment scenarios.
Whether you’re a solo developer looking to simplify your deployment process or an enterprise team seeking better DevOps practices, this new Docker support in WebStencils demo provides the tools you need to succeed in today’s containerized world.
Ready to try it out? Download the latest RAD Studio 12.3 and experience the power of containerized Delphi web applications!
Have questions or feedback about the new Docker feature? Join our community discussions or reach out to our support team. We’d love to hear about your experiences and help you maximize this exciting new capability.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition