OpenMediaVault-Plugin-Developers / openmediavault-compose

openmediavault plugin for docker-compose
14 stars 5 forks source link

Feature request: Store labels using compose.override.yml file. #28

Open jumkey opened 4 months ago

jumkey commented 4 months ago

It would be great if labels could be edited independently and stored in compose.override.yml. e.g. compose.override.yml

services:
  jellyfin:
    labels:
      # for unraid
      net.unraid.docker.managed: 'composeman'
      net.unraid.docker.icon: ''
      net.unraid.docker.webui: 'http://[IP]:[PORT:8096]'
      net.unraid.docker.shell: ''
      # for homepage
      homepage.description: CHANGE_TO_COMPOSE_DESCRIPTION
      homepage.group: Media
      homepage.href: http://openmediavault.local:8096/
      homepage.icon: jellyfin.svg
      homepage.name: CHANGE_TO_COMPOSE_NAME
      # for openmediavault compose? from https://github.com/OpenMediaVault-Plugin-Developers/packages/blob/master/compose-files/jellyfin/compose.override.yml
      org.openmediavault.compose.icon: 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/svg/jellyfin.svg'
      org.openmediavault.compose.webui: 'http://[IP]:[PORT:8096]'
      org.openmediavault.compose.shell: 'bash'
      org.openmediavault.compose.abc: ''
      org.openmediavault.compose.xyz: ''

  redis:
    labels:
      net.unraid.docker.managed: 'composeman'
      net.unraid.docker.icon: ''
      net.unraid.docker.webui: ''
      net.unraid.docker.shell: ''

In the example, I made some assumptions about the future marketplace, including support for icon webui and attach shell. labels that are not related to the main file are also stored separately here.

Others Personally, I prefer convention over configuration. Consider using $name.yml->compose.yml/docker-compose.yml $name.env->.env compose.override.yml/docker-compose.override.yml

For instance, using - .env makes it unnecessary to consider whether the name is immich. https://github.com/OpenMediaVault-Plugin-Developers/packages/blob/33aa9b6d487cd674c15d8f584dcc832894ba6c42/compose-files/immich/immich.yml#L10

ryecoaaron commented 4 months ago

It would be great if labels could be edited independently and stored in compose.override.yml.

What advantage it is having these in a separate file?

Others Personally, I prefer convention over configuration. Consider using $name.yml->compose.yml/docker-compose.yml $name.env->.env compose.override.yml/docker-compose.override.yml

That complicates the plugin and would be a big change. It also only helps using the files from the command line instead of the plugin.

For instance, using - .env makes it unnecessary to consider whether the name is immich.

This is just a mistake and that line can be removed. The plugin always specifies the the environment file by full path and it isn't necessary to specify it in the compose file.

jumkey commented 4 months ago

What advantage it is having these in a separate file?

To prevent clutter in the main file, labels generated by plugins and other labels are stored in separate files.