How to Containerize Drupal CMS with Docker and Deploy Using Terraform on Azure

How to Containerize Drupal CMS with Docker and Deploy Using Terraform on Azure

In this technical write-up, ttrelvik details the process of creating a Docker image for Drupal CMS, addressing the absence of an official distribution image. Unlike Drupal Core's readily available image, Drupal CMS-pre-packaged with SEO, workflows, and media management features-required a custom approach.

The solution was a multi-stage Docker build: a builder stage using Composer to generate a fresh Drupal CMS project (plus extras like Drush or Samlauth), and a final stage combining PHP-FPM with Nginx for production use. This reproducible process ensures consistency in CI/CD pipelines and eliminates manual setup dependencies. The image can be pushed directly to a container registry for deployment.

Deployment was tested with Terraform on Azure Container Apps, requiring only minor path adjustments from earlier Core-based workflows. The result is a portable, automated, GitOps-ready pipeline for Drupal CMS deployments.

? Source code reference: drupal-cms-docker GitHub repo

Reference: Containerizing Drupal CMS (24 August 2025)

Disclosure: This content is produced with the assistance of AI.

Disclaimer: The opinions expressed in this story do not necessarily represent that of TheDropTimes. We regularly share third-party blog posts that feature Drupal in good faith. TDT recommends Reader's discretion while consuming such content, as the veracity/authenticity of the story depends on the blogger and their motives. 

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Upcoming Events

Latest Opportunities