Reputation: 1555
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.
Upvotes: 1
Views: 1148
Reputation: 11772
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 .............
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
Upvotes: 2