Directory Structure
When choosing how to structure Docker containers, you have many options.
One of the most common methods is to have different folders for each service in a directory.
home
β
ββββdocker
β
ββββnginx-proxy-manager
| β docker-compose.yml
| β .env
| |
| ββββdata
| |
| ββββdb
|
ββββsome-service
β docker-compose.yml
β .env
|
ββββdata
There is also the option to have all bind mounts in one directory, plus one large Docker Compose file or several small ones in one folder.
home
β
ββββdocker
β docker-compose.yml
β .env
|
ββββapp-data
|
ββββnginx-proxy-manager
| |
| ββββdb
| |
| ββββdata
|
ββββsome-service
|
ββββdata
home
β
ββββdocker
β docker-compose-nginx-proxy-manager.yml
β .env-nginx-proxy-manager
| docker-compose-some-service.yml
| .env-some-service
|
ββββapp-data
|
ββββnginx-proxy-manager
| |
| ββββdb
| |
| ββββdata
|
ββββsome-service
|
ββββdata
It is also possible to have the containers and the data outside the home directory.
/
β
ββββroot
| |
| ββββdocker
| |
| ββββcontainers
| | |
| | ββββnginx-proxy-manager
| | | | docker-compose.yml
| | | | .env
| | |
| | ββββsome-service
| | | docker-compose.yml
| | | .env
| |
| ββββsecrets
| | nginx-proxy-manager-db-pwd
|
ββββsrv
|
ββββnginx-proxy-manager
| |
| ββββdb
| |
| ββββdata
|
ββββsome-service
|
ββββdata
In the end, you have to decide for yourself which structure seems practical and which is less so.