Deploying WordPress using a Docker network

In this recipe, we will learn to use a Docker network to set up a WordPress server. We will create two containers, one for MySQL and the other for WordPress. Additionally, we will set up a private network for both MySQL and WordPress.

How to do it…

Let's start by creating a separate network for WordPress and the MySQL containers:

  1. A new network can be created with the following command:
    $ docker network create wpnet
    
  2. Check whether the network has been created successfully with docker network ls:
    $ docker network ls
    
    How to do it…
  3. You can get details of the new network with the docker network inspect command:
    $ docker network ...

Get Linux: Powerful Server Administration now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.