nextgenhealthcare / connect-docker

Official Dockerfiles for Connect https://hub.docker.com/r/nextgenhealthcare/connect
Mozilla Public License 2.0
78 stars 51 forks source link

[IDEA] set server.id with environment variable #14

Closed tonygermano closed 1 year ago

tonygermano commented 3 years ago

Normally a unique server id is generated the first time a container starts. In an environment with ephemeral containers, each restart of the service will use a different server id.

Queued messages are associated to a server id. If a server is shut down while messages are still queued, the queued messages will not be processed when the service restarts if the new container does not have the same server id.

The paid Advanced Clustering extension handles this situation, but in a single node setup where the extension is not being used, this is a problem.

Keeping the file in a volume or bind mounting it could be a workaround, but most other settings are now configurable through environment variables without involving persistent storage.

jonbartels commented 1 year ago

Is this as simple as adding something like

#server ID
if ! [ -z "${SERVER_ID+x}" ]; then
  echo -e "server.id = ${SERVER_ID//\//\\/}" > /opt/connect/appdata/server.id
fi

in the entrypoint.sh script?

pladesma commented 1 year ago

This is now fixed in the master branch. It will be included in the Docker Hub images for Mirth Connect 4.3.0.