DEV Community

Cover image for docker-compose and duplicator plugin from WordPress
Ismael Garcia
Ismael Garcia

Posted on • Edited on

4 2 1 1 1

docker-compose and duplicator plugin from WordPress

Small video for those that wants to use docker or docker-compose with the Duplicator WordPress plugin, for local theme or plugin development.

I found my self facing the problem that I was helping a non-profit organization to update their WordPress theme and make small changes in the PHP, CSS code.

And I wanted to host it locally and test my changes, but they have the duplicator plugin installed and backups files from it.

The issue that I face was that I couldn't link the docker db service to the duplicators host input.

The first thing that I try was to bind my docker db service to my localhost, but there was just a small issue with that I have a small project running in the background for my to-dos and other personal things that use MySQL and the port was already in use do my docker-compose
Services didn't want to start because of the same port binding.

I was looking around for a better solution, then I remember that the WordPress service was in the same container as the db service.

So I just pass the service name to the duplicators input and that solve my problem.

But I look around, and I didn't find anything that could help me before, so that is why a make the video.

For the future me, I know that I will find this issue in the future
https://m.youtube.com/watch?feature=youtu.be&v=keOlz9swqds

The docker-compose yml file is the fallowing :

version: '3'
services:
   db:
     image: mariadb
     ports:
       - "3306:3306"
    #  volumes:
    #    - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: leamsigccom
       MYSQL_DATABASE: wordpress
       MYSQL_USER: leamsigccom
       MYSQL_PASSWORD: leamsigccom
   pma:
    image: phpmyadmin/phpmyadmin
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
      MYSQL_ROOT_PASSWORD: leamsigccom
    ports:
      - 8080:80
    links:
      - db:db
   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     volumes:
       - .:/var/www/html/
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: leamsigccom
       WORDPRESS_DB_PASSWORD: leamsigccom
volumes:
  db_data:



Enter fullscreen mode Exit fullscreen mode

Imagine monitoring actually built for developers

Billboard image

Join Vercel, CrowdStrike, and thousands of other teams that trust Checkly to streamline monitor creation and configuration with Monitoring as Code.

Start Monitoring

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay