Difficulty: intermediate
Estimated Time: 45-75 minutes

BoxBoat Logo

WordPress Lab

Now that we have good experience deploying applications as Docker containers, let's try something harder. For this lab, we will deploy WordPress. Specifically, you will need to create two docker container run commands. The first one will deploy MySQL, the second one will deploy WordPress.

We strongly recommend that you build these commands on your local system, in case you lose them on the web host.

Please email feedback to: [email protected]

WordPress

Step 1 of 2

Create the Database

Configure MySQL

The first thing that you'll do is configure MySQL, which is the persistent store for your blog. Remember, you are only creating a docker container run command to launch this. You do not need to create a Dockerfile.

Your run command should provide the following configuration:

  1. name: db
  2. image: mysql:5.7
  3. volumes: db-data:/var/lib/mysql
  4. network: wordpress-net
  5. environment variables:
    1. MYSQL_ROOT_PASSWORD=wordpress
    2. MYSQL_DATABASE=wordpress
    3. MYSQL_USER=wordpress
    4. MYSQL_PASSWORD=wordpress

Note that you will need to create the network and volume before you execute your docker container run command.

Once you run the database, perform docker container logs db to verify it is up.