This commit is contained in:
DoTheEvolution 2021-01-05 13:33:56 +01:00
parent c95d74e230
commit f53699707c
1 changed files with 30 additions and 20 deletions

View File

@ -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.</br>
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:<br>
`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...</br>
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.</br>
@ -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.
---