Native Image: Overwrite configuration settings #8109
-
I'm trying to run a Micronaut application as a native image in a Docker container. With the fat jar approach I could overwrite fields in my Micronaut configuration ( version: "3.9"
services:
temposec:
image: ghcr.io/onstructive/tempo-security/tempo-security:0.2.25-native
environment:
JAVA_TOOL_OPTIONS: "\
-Dmicronaut.http.services.temposec.url=http://host.docker.internal:8090 \
-Dlog.level.ch.onstructive=DEBUG \
-Dmicronaut.caches.tempo-cache.maximumSize=0 \
-Dmicronaut.caches.decision-cache.maximumSize=0 \
-Dmicronaut.caches.attribute-cache.maximumSize=0 \
-Dmicronaut.http.services.temposec.read-timeout=1s
"
ports:
- "127.0.0.1:6000:8080"
- "127.0.0.1:6001:8090" I guess that the native image does not care about the environment variable |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can pass properties as environment variables: version: "3.9"
services:
temposec:
image: ghcr.io/onstructive/tempo-security/tempo-security:0.2.25-native
environment:
MICRONAUT_HTTP_SERVICES_TEMPOSEC_URL: http://host.docker.internal:8090
.... I believe this is more readable than a multi-line string variable. Alternatively, you can set the |
Beta Was this translation helpful? Give feedback.
You can pass properties as environment variables:
I believe this is more readable than a multi-line string variable.
Alternatively, you can set the
MICRONAUT_CONFIG_FILES
env variable to a local file, and include all the configuration there.