diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c20027c..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Try and prevent passwords: -.env diff --git a/README.md b/README.md index c269e0c..ea7bb0c 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,30 @@ -# Nick Yeoman's Collection of Docker compose files +
+ Description of SVG +
-Author: [Nick Yeoman](https://www.nickyeoman.com/). +👤 Author: [Nick Yeoman](https://www.nickyeoman.com/). These cookbooks are created with the intent of using Docker's extend feature. This way, you can run multiple containers in different domains but still have only one file to update. +## 🤔 Assumptions + These compose files make a few assumptions: 1. You are only running on one host. 2. You are using Nginx Proxy Manager (although most have redundant port access). 3. Volumes are stored in the project folder under "data", git ignored and backed up externally. +## 📚 Workflow The intended workflow is as follows: -1. Clone the repository locally ```git clone git@github.com:nickyeoman/docker-compose-cookbooks.git /git-repos/docker-compose-cookbooks``` -2. Create a project directory, usually by domain ```mkdir /projects/domainname-com``` -3. Create a .env file in the project directory ```touch .env``` -4. Add the COOKBOOK Variable to the project's env file: ```COOKBOOK=/git-repos/docker-compose-cookbooks``` -5. Create a .gitignore file in the project directory and ignore "data/" -6. Create a docker-compose.yml file in the project directory with the external code given in the README file in the container folder. +1. Clone the cookbook repository locally ```git clone git@github.com:nickyeoman/docker-compose-cookbooks.git /git-repos/docker-compose-cookbooks``` +2. Change to the directory ```cd /git-repos/docker-compose-cookbooks``` +3. Run the helper cli wizard: ```bash helper.bash``` +4. Commit the new project to git. -## Example +You will likely want to override a number of things in the project folder, such as networks. + +## 🔍 Example Result Here is an example of how your project's docker-compose file might look: @@ -39,4 +44,10 @@ services: - .env networks: - proxy -``` \ No newline at end of file +``` + +with the .env file: + +```text +COOKBOOK=/git-repos/docker-compose-cookbooks +``` diff --git a/_assets/heading.svg b/_assets/heading.svg new file mode 100644 index 0000000..25b65c4 --- /dev/null +++ b/_assets/heading.svg @@ -0,0 +1,52 @@ + + + + + + Docker Compose Cookbooks + + + + + + + + + + + + + + + + + diff --git a/_docs/docker-cheatsheet.md b/_docs/docker-cheatsheet.md new file mode 100644 index 0000000..80c33e7 --- /dev/null +++ b/_docs/docker-cheatsheet.md @@ -0,0 +1,43 @@ +# Docker Cheatsheet + +Reference: [Docker clean up guilde](https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430) + +## Stop all containers + +Stops all running Docker containers by fetching the IDs of all containers and passing them to the `docker stop` command. + +```bash +docker stop $(docker ps -aq) +``` +## Docker Prune + +Cleans up unused Docker objects, including stopped containers, unused networks, dangling images, and build cache. This helps in reclaiming disk space by removing objects not referenced by any containers. + +```bash +docker system prune +``` +## Remove unused images + +Deletes all Docker images that are not currently used by any containers. This command helps in freeing up space taken by old or unused images. + +```bash +docker rmi $(docker images -q) +``` + +## Delete unused volumes + +Removes Docker volumes that are not currently used by any container. This helps in clearing up space used by data volumes that are no longer needed. + +```bash +docker volume rm $(docker volume ls -qf dangling=true) +docker volume ls -qf dangling=true | xargs -r docker volume rm +``` + +## Remove used networks + +Cleans up unused Docker networks. The docker network prune command removes all unused networks, while the docker network rm command can be used to remove specific networks, such as the default "bridge" network if not needed. + +```bash +docker network prune +docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }') +``` diff --git a/docker-reset.bash b/docker-reset.bash deleted file mode 100644 index 8ef3e4f..0000000 --- a/docker-reset.bash +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Docker clean up guilde https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430 - -# kill all containers -echo "*** Killing All Containers ***" -docker stop $(docker ps -aq) - -echo "*** Docker prune ***" -docker system prune - -#remove all images -echo "*** Removing all Docker images ***" -docker rmi $(docker images -q) - -#delete all volumnes -echo "*** Removing all Docker volumes ***" -docker volume rm $(docker volume ls -qf dangling=true) -docker volume ls -qf dangling=true | xargs -r docker volume rm - -#remove all networks -echo "*** Removing all Docker Networks ***" -docker network prune -docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }') - -echo "*** All done ***" diff --git a/stashapp/README.md b/stashapp/README.md index e1d2489..a8d97ae 100644 --- a/stashapp/README.md +++ b/stashapp/README.md @@ -21,6 +21,7 @@ git clone git@github.com:nickyeoman/docker-compose-cookbooks.git Note this setup is meant to be used between two directories, COOKBOOK and PROJECT. In your PROJECT directory set the following env file: +#### Dot env file ```text # Stash App PROD=prod.domain.com @@ -38,7 +39,7 @@ STASH_METADATA=/metadata/ STASH_CACHE=/cache/ ``` -### Docker Compose Extend +#### Docker Compose Extend Now using extend you can call the service: