Wordpress
This article explains how to use Docker Compose to install WordPress with PHPMyAdmin as an extra for database administration. WordPress runs on a Linux, Apache, MySQL & PHP (LAMP) stack.
For the purpose of this tutorial, we use official images from Docker Hub with MariaDB as the Mysql Engine for this tutorial.
-
Create a virtual machine (VM) using a docker official Ubuntu OMI. For more information, see Creating VMs.
-
Allow SSH connection to it and connect to your VM via SSH. For more information, see Accessing a Linux VM.
-
Create a wordpress directory:
$ mkdir wordpress && cd wordpress
-
Create a Docker Compose file in it called docker-compose.yml:
docker-compose.ymlwordpress: image: wordpress links: - wordpress_db:mysql ports: - 80:80 volumes: - ~/wordpress/wp_html:/var/www/html wordpress_db: image: mariadb environment: MYSQL_ROOT_PASSWORD: 53cur3dP455 ports: - 3306:3306 phpmyadmin: image: phpmyadmin/phpmyadmin links: - wordpress_db:db ports: - 8080:80 environment: MYSQL_USERNAME: root MYSQL_ROOT_PASSWORD: 53cur3dP455
-
Launch everything:
$ docker-compose up -d
Docker Compose is not installed by default on the OMI used. To install it, launch these additional commands before:
or alternatively using PIP:
|