Organizing
There are different ways to organize a setup of a dozen different services. I've decided to split up the different app-stacks into different compose files. This way it is easier to change the apps seperately from each other and backup and versioning is also simplified.
The file structure looks something like this:
homeserver/
├── app1/
├── backup/
├── config/
├── data/
├── logs/
└── docker-compose.yml
├── app2/
├── backup/
├── config/
├── data/
├── logs/
└── docker-compose.yml
├── docker-compose.yml
└── .env
Every app gets its own folder with a docker-compose.yml
and additional folders for stuff like configuration files or data stored by the app. In the compose files every service will be listed, that is needed for the app. This could be a combination of the main service, database and webserver for example. Configs for the services will be stores in the respective config folders. Things like databases will be stored in the data folder. Possible backups can be stored in the backup folder. App-specific logs (not those by docker logs
) can be stored in the logs folder.
Persistent data (e.g. userdata like documents or pictures) will be stored seperately.
At the root homeserver
folder, is another docker-compose.yml
file and a single .env
file. From this folder we can start and stop individual or all containers with dcup
or dcdn
for example (see Tips & Tricks for an explanation on the aliases).
The .env
file holds information like database users and passwords, hostname, email-adresses and so on.