From 21e68fd1a5dfd2dccae5b9e3c4372ad396592977 Mon Sep 17 00:00:00 2001 From: Tai Date: Fri, 3 Oct 2025 16:53:20 -0700 Subject: [PATCH] Update README.md --- initial ubuntu setup/README.md | 35 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/initial ubuntu setup/README.md b/initial ubuntu setup/README.md index 7f65330..f2f35df 100644 --- a/initial ubuntu setup/README.md +++ b/initial ubuntu setup/README.md @@ -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-docker compose-on-ubuntu-20-04 **Now on to the Main Installation Guide** @@ -105,13 +105,13 @@ id -nG ``` This should return: **sammy** sudo docker -### 8. Install Docker-Compose +### 8. Install docker compose ``` -sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker compose -sudo chmod +x /usr/local/bin/docker-compose +sudo chmod +x /usr/local/bin/docker compose -docker-compose --version +docker compose --version ``` ### 9. Create a docker network called caddy_net @@ -141,7 +141,7 @@ It allows you to host multiple applications based on the same or different hostn ├── data/ ├── .env ├── Caddyfile - └── docker-compose.yml + └── docker compose.yml ``` To achieve this a part of this folder structure do the following below. ``` @@ -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 docker compose.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 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** ``` -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 Make sure you're in /home/sammy/docker/caddy Then do ``` -docker-compose up -d +docker compose 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 `docker compose 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: 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 docker compose.yml 5. Use nano to add the app specific blocks to your Caddyfile in ` /home/sammy/docker/caddy/Caddyfile` and save. 6. Reload caddy `docker exec -w /etc/caddy caddy caddy reload` 7. Change back to your app specific folder ` /home/sammy/docker/newapp` -8. `docker-compose up -d` to start the new application +8. `docker compose up -d` to start the new application 9. Test your app by visiting yourappsubdomain.yourwebsite.com -That's it! As you do this more often, the more you'll appreciate how fast it is to deploy applications with docker and docker-compose with caddy v2! +That's it! As you do this more often, the more you'll appreciate how fast it is to deploy applications with docker and docker compose with caddy v2! Refer to the readme at: https://github.com/StarWhiz/docker_deployment_notes for command references