diff --git a/mailcow/README.md b/mailcow/README.md new file mode 100644 index 0000000..0c52396 --- /dev/null +++ b/mailcow/README.md @@ -0,0 +1,45 @@ +# Overrides for mailcow-dockerized + +Provides files that are meant to be copied into your location of the [github.com/mailcow/mailcow-dockerized](https://github.com/mailcow/mailcow-dockerized) repo thereby customizing its behavior. + +yq 'del( .services.[].environment.[] | select(. == "TZ=*") ) | del(.. | select( (tag == "!!map" or tag =="!!seq") and length == 0)) | del( .services.[].restart )' /opt/containers/mailcow-dockerized/docker-compose.yml | yq --indent 4 ea '. as $item ireduce ({}; . * $item )' - /opt/containers/mailcow-dockerized/docker-compose.override.yml > /opt/containers/mailcow-dockerized/docker-compose.final.yml + + +* Env variables + ``` + yq 'del( .services.[].environment.[] | select(. == "TZ=*") ) | del(.. | select( (tag == "!!map" or tag =="!!seq") and length == 0))' ... + ``` + From all `.services.[].environment.[]` lists remove items that match the expression `TZ=*`. Realistically this removes the `TZ` environment variable declaration and in some cases leaves the `environment` list empty. If the list now truly is empty delete it. + + Given a file: + ``` + services: + unbound-mailcow: + image: mailcow/unbound:1.16 + environment: + - TZ=${TZ} + volumes: + - ./data/hooks/unbound:/hooks:Z + ``` + Step one does: + ``` + services: + unbound-mailcow: + image: mailcow/unbound:1.16 + ---> environment: + volumes: + - ./data/hooks/unbound:/hooks:Z + ``` + We detect that `environment` is now empty and delete it: + ``` + services: + unbound-mailcow: + image: mailcow/unbound:1.16 + ---> volumes: + - ./data/hooks/unbound:/hooks:Z + ``` +* Restart policy + ``` + del( .services.[].restart ) ... + ``` + From all services delete restart policy declaration. We're defaulting to `unless-stopped` via the `extends:` directive.