Skip to content

Simplify your WordPress development using Docker and Docker Compose.

License

Notifications You must be signed in to change notification settings

jsdiazp/wordpress-docker-compose

Repository files navigation

WordPress Docker Compose

Simplify your WordPress development using Docker and Docker Compose.

With this repository, you can benefit from the features of the following tools to enhance your WordPress site’s performance and security:

Content:

Requirements

  1. Make sure you have the latest version of Docker Engine; to do so, you can follow the instructions in the link below:
    Install Docker Engine

  2. Check that ports 80 and 443 are exposed and available for use.

  3. Update DB root password

echo "your_password" >secrets/db_root_password.txt

Pre-installation

Clone this GitHub repository to your local machine:

git clone https://github.com/jsdiazp/wordpress-docker-compose.git

Navigate to the repository folder:

cd wordpress-docker-compose

Edit wordpress-*.conf file from the nginx/conf.d folder replacing the server_name attribute with your website domain and aliases.

Installation

Run the docker compose command to start the containers:

docker compose up -d

Post-installation

Request SSL certificate

To enable HTTPS and get an SSL certificate for your site, run the following command and follow the instructions displayed:

docker compose exec -ti nginx certbot

Note: Make sure that the DNS A record for the domain and subdomains specified in the nginx server_name attribute point to the public IP of the server on which you have installed this container orchestration.

Enable Wordfence

Install the Wordfence Security plugin on your WordPress site.

Enable the Wordfence firewall by uncommenting the following line in the wordpress-*.ini file from the wordpress/php folder.

# auto_prepend_file = '/var/www/html/wordfence-waf.php'

Finally, restart the Docker Compose project.

docker compose restart

Enter MariaDB CLI

docker compose exec -ti db mariadb -u root --password="$(<secrets/db_root_password.txt)"

Releases

No releases published

Packages

No packages published