"Pre-heat" Xwiki after docker image update

I am using the XWiki docker image xwiki:stable-mysql-tomcat and have it automatically update using watchtower (pulls updated image and restart container with this image). It’s just a private setup so no big deal regarding availability etc. if this happens a couple of times every week.

However, after every update/relaunch of the container I am greeted with a “XWiki is initializing (12%)…” message when I first connect with my browser. Or, if it’s a major update I need to manually upgrade some packages using the web migration wizard which also takes a couple of minutes.

Is there a way to automate this, so that after an update, basically I have a “pre-heated” xwiki installation that I can immediately use?

I am playing around with docker-compose labels like:

- "com.centurylinklabs.watchtower.lifecycle.post-update='curl -L -m 30 -s https://xwiki.xxxxxxxx'"
- "com.centurylinklabs.watchtower.lifecycle.post-update-timeout=10"

or things like:

service:
  xwiki_launch:
    image: "xwiki:stable-mysql-tomcat"
    restart: "no"
    depends_on:
      - xwiki
    entrypoint: [ "bash", "-c", "sleep 120 && curl -L -s -m 60 https://xwiki.xxxxx" ]

But maybe there is just a config option somewhere which automates exactly this so I don’t need to use those workarounds?

Thanks!

Hello, what you’re doing seems good. There’s no config option to preload XWiki (see Loading...).

You could also check xinit or simply do a curlor wget on the home page of the wiki, until it returns a 200 (as you’re doing).

Thanks

Hello,
I think the automatic start of the Wikis would be covered by this extension: https://extensions.xwiki.org/xwiki/bin/view/Extension/Application%20-%20Wiki%20Initializer%20-%20API/

This could replace the additions you are making on a docker level. It is also used by the openDesk project so you have some level of maintenance there.

Not sure about the automatic updates of the XWiki flavor tho…

daubsi, hi! I am not sure what is the way for confluence, but I got rid off this init by using health checks on OpenShift/Kubernetes. The way with curl is right, because we basically have to simulate the entry to XWiki.

Thank you all! Healthchecks might be an options as well! Good idea! I will also have a look at the plugin @lukasM mentioned.

Still don’t understand why this issue exists in the first place, but presumably there are good reasons for it.

Using a healthcheck would be such a nice solution, but unfortunately it doesn’t work in my case as I use traefik as a frontend LB and "curl"ing the traefik URL in the healthcheck doesn’t work as traefik only starts servicing the URL once the container is NOT unhealthy → Chicken/egg problem :frowning: