From f53699707c0ba50fbe5210059584b354d0e89493 Mon Sep 17 00:00:00 2001 From: DoTheEvolution Date: Tue, 5 Jan 2021 13:33:56 +0100 Subject: [PATCH] update --- README.md | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index c402521..8c6eb0d 100644 --- a/README.md +++ b/README.md @@ -23,24 +23,33 @@ * [wireguard](wireguard/) - the one and only VPN to ever consider * [arch_linux_host_install](arch_linux_host_install) +# How to self host various services. + +This is a guide on how to self host various services. + +You do need to have **basic linux and basic docker-compose knowledge**, +the shit here is pretty hand holding and detailed, but it still should not be +your first time running a docker container. + +a certain format is followed + +* **Purpose & Overview** - basic overview and intented use +* **Files and directory structure** - lists all the files/folder involved + and their placement +* **docker-compose** - the recipe how to build a container, with .env file too +* **Reverse proxy** - reverse proxy specific settings, if the container has + some webserver providing web interface +* **Update** - how to update the container, usually just running Watchtower +* **Backup and restore** - of the entire container using borg backup +* **Backup of just user data** - steps to backup databases and other user data +* **Restore the user data** - steps to restore user data in a brand new setup + + The core of the setup is Caddy reverse proxy.
It's described in most details. -You do need to have **basic docker and docker-compose knowledge**, -shit here is pretty hand holding and detailed, but it still should not be -your first time running a docker container. - # Some extra info -### Caddy - -When making changes to `Caddyfile`, the config needs to be reloaded afterwards. - -On the docker host:
-`docker exec -w /etc/caddy caddy caddy reload` - -Assuming container name is kept as `caddy`. - ### Compose When making changes use `docker-compose down` and `docker-compose up -d`, @@ -50,7 +59,8 @@ not just restart or stop/start. simple copy paste should suffice * you **do** need to fuck with `.env` file, that's where all the variables are -Often the `.env` file is used as `env_file` +Often the `.env` file is used as `env_file`, +which can be a bit difficult concept at a first glance. `env_file: .env` @@ -64,12 +74,12 @@ Often the `.env` file is used as `env_file` Variables in this file will be available in the running container, but not during building of the container. -So a setup having `env_file: .env` in the compose mixes these two together. +So a compose file having `env_file: .env` mixes these two together. -Benefit is that you do not need to make changes at multiple places, -adding variable or changing a name in `.env` does not require -to also go in to compose to add/change it there...
-Also the compose file looks less cramped. +Benefit is that you do not need to make changes at multiple places. +Adding variables or changing a name in `.env` does not require you +to also go in to compose to add/change it there... also the compose file +looks much cleaner, less cramped. Only issue is that **all** variables from the `.env` file are available in all containers that use this `env_file: .env` method.
@@ -79,7 +89,7 @@ variable that is intented for a different container of the stack. In the setups here it works and is tested, but if you start to use this everywhere without understanding it, you can encounter issues. So first troubleshooting step should be abandoning `.env` and write out -the variables directly in the compose file under containers that want them. +the variables directly in the compose file only under containers that want them. ---