Open almereyda opened 1 year ago
If we agree on compose.yaml
to reduce ambiguity and break interoperability with previous docker-compose
versions, we can also use service profiles to identify components in the stack that belong together.
Their example is quite telling about which use case is targeted with this feature:
docker compose run db-migrations
Which directly relates this conversation to #2
Some nice patterns to use Docker Compose to its full extent can be found in:
extends
is a beastservice_completed_successfully
for migration or init containers?These features could also help to structure the template better:
We can also use some YAML syntax rules to deduplicate code, namely anchors and alias nodes
as exemplified in i.e.
This is also where I learned about service_completed_successfully
Similar to them, we could also agree on better task execution runner than bash, and specify more jobs in a package.json
instead.
Later we could consider more sophisticated task runners, like just
et al.
In the new Compose, we can also use Docker Stack's deploy
for specifying resources
, if applicable (eventually good to identify memory leaks locally):
is a nice example about how a x-common:
block and configurations therein are being reused in services et al.
It also shows how a single value can be reused.
In addition to the previous YAML examples, here's a writeup (found via the veggiemonk/awesome-docker list of Docker resources and projects:
Is your feature request related to a problem? Please describe.
Currently the
docker-compose.yml
manifests, which do not carry aversion:
tag and are as such Compose v2 manifests, can also be interpreted by deprecateddocker-compose
clients.This in return can lead to subtle errors in the interpretation of the provided keys and values, where implementation details have changed between
docker-compose
/Compose v1 anddocker compose
/Compose v2.Describe the solution you'd like
mv docker-compose.yaml compose.yaml
Describe alternatives you've considered
We remain backwards compatible and support multiple runtime engines at the same time.
Additional context
Actually we want to run the stack locally in Kubernetes, but we are just not there yet.