docker-cms: PHP 8.5 Docker Image for WordPress and CMS Hosting

What is docker-cms?

docker-cms is a maintenance and troubleshooting container for PHP-based CMS environments — WordPress, Joomla, Drupal, and similar. It is not meant to run your CMS. It is meant to work on it.

The idea is simple: mount your existing site directories into this container and get immediate access to a full suite of tools — without touching your running production setup. Resize images, run database maintenance, inspect files, push backups, or debug a broken install, all from a clean isolated shell alongside your live stack.

Why Use docker-cms?

Maintenance without risk

  • Work on the files, not inside the running container. Mount /var/www from your production container and operate on the same files — without exec-ing into a container that has none of the tools you need.
  • Image resizing and conversion. ImageMagick (convert, mogrify, identify) and libvips with the php-vips bindings are both available. Bulk-resize an upload directory, strip EXIF metadata, or convert legacy formats without writing a plugin or pulling in a separate tool container.
  • Database maintenance. The MariaDB client is installed. Connect to your database and run OPTIMIZE TABLE, check for corruption, export a clean dump, or fix a broken options row — directly from the shell, without stopping anything.
  • Backup and transfer. rsync, git, openssh-client, zip, and unzip are all present. Pull a remote backup, push files offsite, clone a repo into a theme directory, or unpack an uploaded archive — no extra containers needed.
  • WP-CLI for everything WordPress. Run wp search-replace, wp db export, wp plugin update --all, or wp cron event run against the live site files. The wp alias runs as www-data so file ownership stays correct.
  • Composer for dependency management. Run composer install, composer update, or dump autoloaders directly in the mounted site directory without installing Composer into your production image.

Troubleshooting

  • Interactive editors and file managers. nano and mc (Midnight Commander) let you edit config files, browse directory trees, and inspect permissions without a GUI or a remote IDE connection.
  • jq for JSON inspection. Parse wp-config.php exports, inspect REST API responses, or pretty-print plugin metadata files on the spot.
  • pv for visible progress. Pipe large SQL dumps or archive files through pv and get real-time throughput and ETA — useful when a slow import leaves you wondering if anything is actually happening.
  • www-data has a real shell. The www-data user is configured with /bin/bash. Switch to it with su www-data and reproduce permission or file-ownership problems exactly as the web process sees them.
  • curl and wget for HTTP diagnosis. Test endpoints, download patches, or verify that your site responds correctly — from inside the same network as your stack.
  • Bash aliases pre-configured. Coloured ls and grep are set up in /root/.bashrc so log scanning and directory listings are readable the moment you open a shell.

Typical Usage

docker run --rm -it 
  --volumes-from my-wordpress-container 
  eilandert/docker-cms:latest bash

Or with explicit mounts:

docker run --rm -it 
  -v /srv/wordpress:/var/www 
  -v /srv/db-backups:/backups 
  eilandert/docker-cms:latest bash

Your production containers keep running. docker-cms just gets access to the same files and network, does its work, and exits.

Source

The Dockerfile is maintained in the eilandert/dockerized repository under src/docker-cms/. The image is published to Docker Hub as eilandert/docker-cms:latest.

Leave a comment