I have webbapp based on Spring. To configure it I use .yml files. To convert environmental variable from spring/backend .yml format to docker-compose.yml environment section I have to change indents into underscores. Example:
application.yml
spring:
mail:
properties.mail.smtp:
auth: true
docker-compose.yml
environment:
SPRING_MAIL_PROPERTIES.MAIL.SMTP_AUTH: true
But some property names contain underscores itself. Like this:
spring:
jpa:
properties:
hibernate:
temp:
use_jdbc_metadata_defaults: false
How should I translate such properties (with underscores in names) to the environment section in docker-compose.yml?
This question is not a duplicate. Mentioned similar question does not answer my question. Question How to set a Spring Boot property with an underscore in its name via Environment Variables? is about how to represent properties with underscores in Spring Boot and accepted answer shows how property file entry is interpreted by Spring. There is a link to SystemEnvironmentPropertySource.java
class which is responsible for translation and interpretation of properties in Spring. My question asks about .yml file interpretation in Docker-Compose. So I need basically similar answer to the accepted one in the mentioned thread but about how Docker-Compose interprets .yml properties to environment variables.