Trying to understand how the docker-compose file was created as I want to replicate this into a kubernetes deployment yaml file.
In reference to a cookiecutter-django's docker-compose production.yaml
file:
...
services:
django: &django
...
By docker-compose design, the name of service here is already defined as django
but then I noticed this extra bit &django
. This made me wonder why its here. Further down, I noticed the following:
...
celeryworker:
<<: *django
...
I don't understand how that works. The docker-compose docs have no reference or mention for using <<
let alone, making a reference to a named service like *django
.
Can anyone explain how the above work and how do I replicate it to a kubernetes deployment or services yaml file (or both?) if possible?
Edit: The question that @jonsharpe shared was similar but the answer wasn't clear to me on how its used.