Univention Bugzilla – Bug 56323
UCR templating in docker compose file does not work as documented
Last modified: 2023-07-19 14:15:07 CEST
The Appcenter documentation explains how to access app settings in the docker compose file: https://docs.software-univention.de/app-center/5.0/en/get_started.html#multi-container-setup This does only work, if the compose file contains a @!@ @!@ block, otherwise the values are empty on the resulting docker compose file! Example of working compose file: @!@ # just for the UCR template to work.. @!@ version: '3.1' services: authorization-api: image: gitregistry.knut.univention.de/univention/components/authorization-engine/guardian:branch-9-create-appcenter-apps-for-authz-and-management-api security_opt: - seccomp:/etc/docker/seccomp-systemd.json environment: GUARDIAN__AUTHZ__ADAPTER__SETTINGS_PORT: env GUARDIAN__AUTHZ__ADAPTER__PERSISTENCE_PORT: static_data GUARDIAN__AUTHZ__ADAPTER__POLICY_PORT: opa STATIC_DATA_ADAPTER__DATA_FILE: /tmp/test_data.json OPA_ADAPTER__URL: http://opa:8181/ GUARDIAN__AUTHZ__LOGGING__LEVEL: @%@guardian-authorization-api/logging/level@%@ GUARDIAN__AUTHZ__LOGGING__STRUCTURED: @%@guardian-authorization-api/logging/structured@%@ GUARDIAN__AUTHZ__LOGGING__FORMAT: @%@guardian-authorization-api/logging/format@%@
Okay together with Felix we found the actual problem. The settings had no `Show` value configured, which means that it defaults to settings. That actually means that the appsettings are only set after the docker compose file was generated. I could fix this problem by adding `Show=Install,Settings` to my app settings. Now they were set before the generation of the docker compose file and I can use them with `@%@`. This should be either documented or changed so that the default values for settings are always available when generating the compose file. P.S. The weird behavior I stated was due to the fact that my settings were scoped for outside and thus on a reinstall I did for testing my change to @!@ the UCR variables were set already.