Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Making Delphi Web Apps Docker-Ready in One Click

Docker

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.

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:

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:

How It Works

The process is very simple:

  1. Select the Docker build configuration in Delphi (Release → Docker with Linux platform)
  2. Build your project (Ctrl+Shift+F9)
  3. Run the container with a single command
  4. 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:

[crayon-68c5ef96156d5073465445/]

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:

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.

Exit mobile version