diff --git a/README.md b/README.md index c70733f..864dadc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

- Caddy + Caddy

@@ -15,7 +15,7 @@
-

Install Caddy with packages (xcaddy) inside Docker Desktop

+

How to efficially install, host, and maintain lightning fast Wordpress websites inside Docker Desktop.


@@ -24,12 +24,14 @@ # Navigation - [Prerequisite](#prerequisite) -- [Install](#install) - - [Configuring docker-compose.yml file](#configuring-docker-composeyml-file) - - [Configuring .env file](#configuring-env-file) - - [Configuring dockerfile.caddy file](#configuring-dockerfilecaddy-file) - - [Configuring Caddyfile](#configuring-caddyfile) -- [Execute and finish](#execute-and-finish) +- [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)
@@ -37,52 +39,21 @@ # Prerequisite -- **If you have Cloudflare managing your domain, make the the TLS/SSL encryption mode is set to Full (Strict) and NOT Flexible.** +- **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). Be default, domains are set to Flexible and you'll get thrown in an infinite loop when using a reverse proxy.** -- **When adding CNAME entries to your domains, make sure Cloudflare's proxy is disabled for each CNAME record.** +- **For these instructions we'll be using the example domain called " website.com " and will be changing things to " wp-website-com " in the appropriate locations in the files.** + +- **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**

-# Install +# Creating a Custom Network -

This tutorial will show you how to install Caddy with with packages automatically with xcaddy as a Docker container. Installing extra packages is optional but it's good to have a few of them.

- -
- -
- -

1️⃣

- -## Configuring docker-compose.yml file - -* **This is the main Caddy docker-compose.yml file that you will use to create your container.** - -* **Instead of specifying an image under the caddy services, we're going to specify a Docker file In which we Tell it how to build a custom caddy image for us.** - -* **If you DO NOT want to build a custom caddy image and just use the default caddy image, you can delete this section that says:** - -```yml -build: - context: . - dockerfile: dockerfile.caddy -``` -**and replace it with:** - -```yml -image: caddy:latest -``` - -* **It's always going to restart unless we manually stop it.** - -* **We're telling it that it has env file to reference.** - -* **We are mapping it to ports 80 and 443.** - -* **We are creating five volumes for it.** - -* **And finally we are creating a custom caddy Network.** +* **Creating a Custom Network**

@@ -96,7 +67,21 @@ image: caddy:latest
-

2️⃣

+## Folder Organization + +* **Folder Organization** + +

+ + + Docker + + +

+ +
+ +
## Configuring .env file @@ -114,17 +99,33 @@ image: caddy:latest
-

3️⃣

+## Configuring docker-compose.yml file -## Configuring dockerfile.caddy file +* **Configuring docker-compose.yml file** -* **This is the dockerfile.caddy file that your docker-compose.yml file will use to create your custom Caddy image.** +```yml +code +``` -* **Inside this file, we're going to give it some commands to create the image from caddy:builder, include some GitHub packages, attach them to the caddy:latest.** +

+ + + Docker + + +

-* **And then once it's built, copy it to a specific directory** +
-* **When you launch the docker-compose.yml file, it will trigger this file to build your custom image automatically.** +
+ +## Execute and Test + +* **Execute and Test** + +```ps1 +docker-compose up -d +```

@@ -138,20 +139,10 @@ image: caddy:latest
-

4️⃣

- -## Configuring Caddyfile +## Reverse Proxy Steps * **This is the Caddyfile. This file tells Caddy what and how to do things.** -* **Inside of the Caddyfile, I've organized it into three sections. Global, Snippets, and Sites.** - -* **In the Global section, you're going to specify some default parameters .** - -* **In the Snippets section, you're going to be creating variables and functions that you can import into your websites.** - -* **Under the Site section, you will list your websites as well as commands for Caddy to perform on your website.** -

@@ -164,22 +155,32 @@ image: caddy:latest
-# Execute and finish +# wp-config.php configuration -**Once you have all of the files customized to your liking and all four of them are sitting in the same directory, you'll be ready to launch the yml file.** +**wp-config.php configuration** -**You can do this by right-clicking in an empty space in the folder where all your files are located and selecting 'Open in Terminal'.** +```php +docker-compose up -d +``` -**That opens a Powershell window inside that direcotry where you can enter this code to launch everything.** +
+ +
+ +# Caddyfile configuration + +**wp-config.php configuration** ```ps1 docker-compose up -d ``` -**And that's it! Caddy should be live ina Docker container and actively acting as a reverse proxy!** +

Support the channel so I can make more tutorials!

-

If this tutorial helped you out, feel free to buy me a coffee!

\ No newline at end of file +

If this tutorial helped you out, feel free to buy me a coffee!

+ +
\ No newline at end of file