shantanoo-desai / komponist

A Composer for your favorite IoT/ IIoT container stacks with Ansible + Jinja2 + Docker Compose v2
GNU Affero General Public License v3.0
25 stars 2 forks source link

[docker-compose] Refactor the generated compose file to use the `include` spec #120

Open shantanoo-desai opened 10 months ago

shantanoo-desai commented 10 months ago

Description

Currently, the split docker-compose.<service>.yml files are combined together using docker compose config -o docker-compose.yml. With the new [include][1] spec in the updated Compose versions, it is not possible to have a simplified main docker-compose.yml file and it can still be validated using docker compose config

Effort

Refactoring will be required in the form of a Jinja2 template for all the configured services into a main docker-compose.yml.j2 with a list as follows:

include:
  - path: ./docker-compose.<serviceA>.yml
  - path: ./docker-compose.<serviceB>.yml 

This refactoring may be beneficial to include custom Docker Apps into the existing Compose project.