Sets up and runs an automated isolated instance of an existing wordpress installation in docker containers.
- Docker-engine or docker-machine.
- Docker-compose.
- SQL dump/export from the website database.
- A backup of the wordpress servers "wp-content" directory.
- Enough free harddrive space (proportional to website size x3)
- Move SQL export of database to "database" directory and rename to "dump.sql".
- Copy "wp-content" directory from website server to "wordpress" directory.
- Copy "wp-content" directory and rename it to "wp-content-original", this will let you reset the files.
- Start docker
- Run "docker-compose up -d" from commandline in the "instantwordpress" directory.
All dependencies are then downloaded, and the Docker containers are initialized and run. After dependencies are initially downloaded, startup shouldn't take more than half a minute on the average pc.
If docker-machine (docker toolbox) and not docker-engine (native docker) is installed, ports must be forwarded on the virtualbox using the command:
docker-machine ssh default -L 8000:localhost:8000 -L 8080:localhost:8080
This command must be run after container startup and can be quit using "exit".
The two host-facing services are wordpress itself and phpmyadmin. These can be accessed through:
wordpress: localhost:8000 phpmyadmin: localhost:8080
To stop the docker containers run "docker-compose down" from commandline in the "instantwordpress" directory. The wp-content folder is mounted by the docker container, and the database is imported to the container and thereafter persistent between runs. These can be reset by using commands:
- stop docker and delete database: docker-compose down -v
- delete "wp-content" directory and replace with new copy of "wp-content-original"
- start docker: docker-compose up -d
To export the database, use phpmyadmins export options.
Warnings: If you are using docker toolbox/machine (on pc) always issue commands using the quickstart terminal.