mirror of
https://github.com/chatmail/relay.git
synced 2026-05-15 19:14:44 +00:00
docker: auto-detect image upgrades and include install stage
Without version tracking, if a new image requires the install stage (e.g. new package versions), the default configure,activate will skip it and potentially fail silently. At build time, the git hash is written to /etc/chatmail-image-version. At runtime, setup_chatmail_docker.sh compares it against the persisted /home/.chatmail-running-version (survives container restarts via the /home volume). If they differ, the install stage is automatically prepended to CMDEPLOY_STAGES. After a successful deploy, the running version is updated. Files: docker/chatmail_relay.dockerfile:68-69, docker/files/setup_chatmail_docker.sh:27-48
This commit is contained in:
@@ -61,6 +61,9 @@ RUN CMDEPLOY_STAGES=install \
|
||||
RUN cp -a www/ /opt/chatmail-www/
|
||||
|
||||
RUN rm -f /tmp/chatmail.ini
|
||||
|
||||
# Record image version for upgrade detection at runtime
|
||||
RUN git rev-parse HEAD > /etc/chatmail-image-version 2>/dev/null || echo "unknown" > /etc/chatmail-image-version
|
||||
# --- End build-time install ---
|
||||
|
||||
ENV CHATMAIL_INI=/etc/chatmail/chatmail.ini
|
||||
|
||||
Reference in New Issue
Block a user