Follow the following steps to get a running clone of your wordpress blog in a local docker environment on MacOS
- Docker is installed
- GIT is installed
- You have full backup of your wordpress blog including a database dump.
- Clone this GIT repository to any directory on your Mac. To do so, run the following command:
git clone https://github.com/Cevi-Uster/ - Create the folders for the files and the database. Run the following commands to do so:
mkdir -p data/wpmkdir -p data/database - Copy the files from the backup in to the folde
data/wp - Copy the MySQL dump into
data/databaseand rename it to database.sql - Make the file
replaceUrlInDatabase.shexecutable. To do so, run the following command:chmod 755 replaceUrlInDatabase.sh - Adjust the
replaceUrlInDatabase.shaccording to your needs and run it. - Start Docker with the following command:
docker-compose -up
Open your favorite browser and navigate to (http://127.0.0.1:8000).
If everything works as expected, stop docker by pressing Ctrl+C in the shell and restart it by running the folling command:
docker-compose up -dto start Docker in detached mode.
In my environment. Wordpress came up with the default theme instead of our own child-theme. I had to reset it by hand in the clone.