Using Docker version 28.0.4, build b8034c0 with the example docker-compose.yml gives the following warning:
WARN[0000] /tmp/tmp-mw/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
This is a bit disconcerting for new sysadmins. Removing the attribute without replacement would be ideal, if not prevented by WMF internal compatibility.