feat(docker): allow dynamic Erlang cookie via environment variable#104
Merged
Annopaolo merged 1 commit intoastarte-platform:release-1.2from Apr 4, 2025
Conversation
This PR modifies the `vernemq.sh` entrypoint script to support dynamic configuration of the Erlang distribution cookie used for clustering VerneMQ nodes. Key changes: - The script now reads the `RELEASE_COOKIE` environment variable, if set, and injects it into the vm.args file at runtime. - If `RELEASE_COOKIE` is not set, the behavior falls back to the default (previously set value `vmq` in vm.args), ensuring backward compatibility. Motivation: In our deployment architecture, each instance of Astarte (Elixir services + VerneMQ with the custom plugin) will require a possibly unique Erlang cookie to securely form a cluster between the Erlang nodes. This change enables per-instance configuration without modifying the Docker image or baked-in vm.args file. Signed-off-by: Davide Briani <davide.briani@secomind.com>
Annopaolo
approved these changes
Apr 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modifies the
vernemq.shentrypoint script to support dynamic configuration of the Erlang distribution cookie used for clustering VerneMQ nodes.Key changes:
RELEASE_COOKIEenvironment variable, if set, and injects it into the vm.args file at runtime.RELEASE_COOKIEis not set, the behavior falls back to the default (previously set valuevmqin vm.args), ensuring backward compatibility.In our deployment architecture, each instance of Astarte (Elixir services + VerneMQ with the custom plugin) will require a possibly unique Erlang cookie to securely form a cluster between the Erlang nodes. This change enables per-instance configuration without modifying the Docker image or baked-in vm.args file.