anandslab / docker-traefik

Docker media and home server stack with Docker Compose, Traefik, Swarm Mode, Google OAuth2/Authelia, and LetsEncrypt
https://www.smarthomebeginner.com/
MIT License
2.88k stars 630 forks source link

Shared Extension Fields between include files #323

Open GuyKh opened 9 months ago

GuyKh commented 9 months ago

Hey,

Looking at this structure - there's a "main" docker-compose file which includes small, "by-service" compose files (in compose folder).

However, despite I see the use of Extension Fields (i.e. <<: *common-keys-core in archive folder files) - I don't see it's being used as part of this divide strategy. Is this possible?

E.g.

docker-compose-ws.yml:

...
# Keys common to some of the core services that we always to automatically restart on failure
x-common-keys-core: &common-keys-core
  networks:
    - npm_proxy
  security_opt:
    - no-new-privileges:true
  restart: always
...

include:
...
  - compose/$HOSTNAME/portainer.yml
...

portainer.yml:

services:
  # Portainer - WebUI for Containers
  portainer:
    container_name: portainer
    <<: *common-keys-core
    ...
GuyKh commented 9 months ago

Well -- looking here - it seems that it's impossible

If you think of a workaround, please let me know