How to efficiently install, host, and maintain lightning fast Wordpress websites inside Docker Desktop.
# Navigation
- [Prerequisite](#prerequisite)
- [Creating a Custom Network](#creating-a-custom-network)
- [Folder Organization](#folder-organization)
- [Configuring .env file](#configuring-env-file)
- [Configuring docker-compose.yml file](#configuring-docker-composeyml-file)
- [Execute and Test](#execute-and-test)
- [Reverse Proxy Steps](#reverse-proxy-steps)
- [wp-config.php configuration](#wp-configphp-configuration)
- [Caddyfile Configuration](#caddyfile-configuration)
# Prerequisite
- **If you are using Cloudflare to host your domain, you NEED to make sure that it's SSL/TLS encryption mode is set to 'Full (strict)'. By default, domains are set to 'Flexible' and you'll get thrown in an infinite loop when you try and go to your website while using a reverse proxy.**
- **For these instructions we'll be using the example domain called 'website.com' and will be changing names and code to match it accordingly, like this 'wp-website-com'.**
- **For very nice organization, I recommend keeping the ' wp- ' part at the beginning of the naming scheme so you can easily filter out containers and find what you're looking for very quickly and neatly.**
- **The password to extract all of the tutorial files from the zip file is: JHammaH**
- **Create a folder called ' wordpress ' in an easy to find directory like: '** c:/docker/**wordpress '**
- **Extract the contents of the downloaded zip file to inside the new ' wordpress ' folder. You will see three files. A .bat file, a dockerfile, and a folder called ' wp-new-site '**
# Creating a Custom Network
* **Before you do anything else, you'll need to create a custom network specifically for your Wordpress sites so you don't run out of IP's which can confuse docker and cause issues with reverse proxies.**
* **Conveniently I made a simple batch file called 'create-docker-wordpress-network.bat' that all you need to do is double-click.**
* **It will create the network range 10.64.0.0 within Docker and then delete itself since you only need to run it once.**
* **If you want to use a different network range instead of 10.64.0.0, you can right click on the batch file and change the range to whatever you want. Then save the bat file and run it.**
# Folder Organization
* **Now you'll need to organize the folder names, which is very important.**
* **Copy the ' wp-new-site ' folder and paste it in the same directory and it should create a new folder called ' wp-new-site - Copy '. This will leave the ' wp-new-site ' folder untouched so it can remain a template that you can copy/paste as many times as you want for any new site you want to launch.**
* **Rename the new folder you just created, ' wp-new-site - Copy ', to match your specific domain. Ex. ' wp-website-com '. You're keeping the 'wp-' part for easy filtering. You're changing the word 'new' to whatever your domain is. Then you're changing the word 'site' to whatever your domain extention is.**
* So here are a couple of examples:
* For 'jhammah.com', you would change 'wp-new-site' to 'wp-jhammah-com'
* For 'takedownthe.gov', you would change 'wp-new-site' to 'wp-takedownthe-gov'
* For 'dronework.pro', you would change 'wp-new-site' to 'wp-dronework-pro'
* **For this tutorial, I'll be creating a site for the domain I own, scrapyardplays.com, which means I'll change 'wp-new-site' to 'wp-scrapyardplays-com'**
# Configuring .env file
* **This is the .env file. Here you will want to enter your cloudflare API token as well as the email address you log into cloudflare with. This .env file will create variables that you can reference in your Caddyfile.**
# Configuring docker-compose.yml file
* **Configuring docker-compose.yml file**
```yml
code
```
# Execute and Test
* **Execute and Test**
```ps1
docker-compose up -d
```
# Reverse Proxy Steps
* **This is the Caddyfile. This file tells Caddy what and how to do things.**
# wp-config.php configuration
**wp-config.php configuration**
```php
docker-compose up -d
```
# Caddyfile configuration
**wp-config.php configuration**
```ps1
docker-compose up -d
```
Support the channel so I can make more tutorials!