0

I have had this problem very often in the past: I have a wordpress site that is in production. I deployed the site manually from my local machine. So if there were changes, I exported the database and the files from the local file system again and imported them on the remote production server. That sucks, especially if you have a different enviroment on your remote server (different OS, different PHP version, different MySQL, etc.).

So I decided to use Docker and Docker containers to run my Wordpress site.

During my work as developer for Java and Node.js applications I started to love the way you can test and deploy changes from your development to your production environment using a Continuous Delivery pipeline.

How can I establish this workflow on a Wordpress site + MySQL that are running in Docker containers? Especially, how can I apply the changes I have made on the local MySQL to the remote MySQL DB?

SOLVED: I have found a good discussion and explanation on how to keep data persistent on StackOverflow: go here

Also this tutorial from DigitalOcean might help you.

Community
  • 1
  • 1
Marcel
  • 1,277
  • 3
  • 15
  • 37

1 Answers1

1
  1. First, you should put wordpress source code on git or svn server. Then you can clone it into docker container.
  2. After you built images for wordpress and mysql, you can map port to external ip address, which you can connect to mysql database from your computer with command:

    docker run -d -it -port 3306:3306 .............

  3. You can follow this to do: https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-and-phpmyadmin-with-docker-compose-on-ubuntu-14-04

Thanh Nguyen Van
  • 6,018
  • 4
  • 20
  • 34