Docker Compose with Traefik and lots of services
Docker Compose with Traefik and lots of services
Your (my) own server configuration, managed by docker-compose, with comprehensive default configuration.
IF you are using [docker compose version /dev/null | sort -n -k2 | cut -f 1 | awk '{print "-f "$0}') $@ }
### Run
```bash
SITE=tom.moulard.org docker-compose up -dNow you have your own server configuration.
To be a little more consistent with the management, you can use a .env file
and do:
cp .env.default .envAnd edit the .env file to use the correct configuration.
The docker-compose function gather all docker-compose files in order to have
the whole configuration in one place (see docker-compose config).
docker-compose downThere should be only one service by folder:
For example, le folder traefik/ contains all the necessary configuration to
run the traefik service.
Thus each folder represent an available service.
The directory must follow the following architecture:
service/
├── conf
│ └── ...
├── data
│ └── ...
├── docker-compose.servicename.yml
├── logs
│ ├── access.log
│ └── error.log
└── README.md
…
bash
echo "USERS=$(htpasswd -nB $USER)" >> .envYou can add a new set of credentials by editing the .env file like
USERS=toto:pass,tata:pass, ...The .env.default is generated using this command:
grep '${' **/docker-compose.*.yml | sed "s/.*\${\(.*\)}.*/\1/g" | cut -d":" -f 1 | sort -u | sort | xargs -I % echo "%=" >> .env.defaultEdit the file /etc/hosts to provide the reverse proxy with good URLs.
For example, adding this in your /etc/hosts will allow to run and debug the
Traefik service locally:
127.0.0.1 traefik.moulard.orgdocker-compose scale nginx=2! Warning: This is enforced for all PRs.
We are using yamllint to lint our yaml files. You can install it by looking at the official documentation.
Once installed, you can run the following command to lint all the yaml files:
yamllint .! Warning: This is enforced for all PRs.
You can run the following command to check that the docker-compose files are correctly written:
./test.shIt tests that:
.env.default fileOnce this shell scritp is run, if the tests failes, you can see a bunch of
modified files (e.g., test_config.yml) that indicates what is wrong.
Note that the GitHub Action will run this script for you, and provides a
patch.patch file that should solve most of your issues.
Main author:
Gitlab helper:
Discord MusicBot/minecraft:
No open issues yet, or sync has not completed.