@ -14,8 +14,8 @@ If you are an **experienced user** and want to blaze thru steps 1 and 8. You can
@@ -14,8 +14,8 @@ If you are an **experienced user** and want to blaze thru steps 1 and 8. You can
**The references I used to write the rest of these notes are bulleted below:**
* Initial Server Setup: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04
* How to install Docker: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04
* How to install docker-compose: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04
* How to install Caddy: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04
* How to install docker compose: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker compose-on-ubuntu-20-04
* How to install Caddy: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-dockercompose-on-ubuntu-20-04
**Now on to the Main Installation Guide**
@ -105,13 +105,13 @@ id -nG
@@ -105,13 +105,13 @@ id -nG
@ -141,7 +141,7 @@ It allows you to host multiple applications based on the same or different hostn
@@ -141,7 +141,7 @@ It allows you to host multiple applications based on the same or different hostn
├── data/
├── .env
├── Caddyfile
└── docker-compose.yml
└── dockercompose.yml
```
To achieve this a part of this folder structure do the following below.
```
@ -153,22 +153,21 @@ cd caddy
@@ -153,22 +153,21 @@ cd caddy
```
So now you're inside the caddy folder.
At minimum you will need a **.env**, **Caddyfile** and **docker-compose.yml**. the config/ and data/ folders are automatically generated by docker-compose later.
At minimum you will need a **.env**, **Caddyfile** and **docker compose.yml**. the config/ and data/ folders are automatically generated by docker compose later.
#### Creating .env
Do this with `nano .env` and add the following lines in the .env file. Do not use subdomain. Just use yourrootdomain.com, in this example I'm using example.com
The purpose of the .env file is to substitute variables in your docker-compose.yml in the same directory.
The purpose of the .env file is to substitute variables in your dockercompose.yml in the same directory.
**.env**
```
MY_DOMAIN=example.com
```
**Ctrl+O** to save file.
#### Creating docker-compose.yml
A small explanation about this can be found [here](https://github.com/StarWhiz/docker_deployment_notes#commonly-added-lines-added-to-app-specific-docker-composeyml-files)
**docker-compose.yml**
#### Creating dockercompose.yml
A small explanation about this can be found [here](https://github.com/StarWhiz/docker_deployment_notes#commonly-added-lines-added-to-app-specific-dockercomposeyml-files)
**dockercompose.yml**
```
version: "3.7"
services:
caddy:
@ -230,9 +229,9 @@ For now your Caddyfile can be the same as the example above if you plan on deplo
@@ -230,9 +229,9 @@ For now your Caddyfile can be the same as the example above if you plan on deplo
Make sure you're in /home/sammy/docker/caddy
Then do
```
docker-compose up -d
dockercompose up -d
```
to start caddy. To bring it down you can do `docker-compose down`.
to start caddy. To bring it down you can do `dockercompose down`.
### Time to deploy Applications
Congrats you are now ready to deploy applications. The other applications will be deployed the same way you just deployed Caddy! I recommend you deploy [wordpress](https://github.com/StarWhiz/docker_deployment_notes/tree/master/wordpress) first if you are new to this.
@ -242,13 +241,13 @@ The general flow for adding new application like wordpress for example is:
@@ -242,13 +241,13 @@ The general flow for adding new application like wordpress for example is:
1. Find an application specific [guide](https://github.com/StarWhiz/docker_deployment_notes#application-specific-deployment-guides)
2. Make a new app specific folder in `/home/sammy/docker/` with `mkdir newapp`
3. Navigate inside the new app specific folder with `cd newapp`
4. Create the mimimum files as mentioned in the app specific guides, but don't worry about creating folders inside the newapp folder as they are auto generated in docker-compose.yml
4. Create the mimimum files as mentioned in the app specific guides, but don't worry about creating folders inside the newapp folder as they are auto generated in dockercompose.yml
5. Use nano to add the app specific blocks to your Caddyfile in ` /home/sammy/docker/caddy/Caddyfile` and save.