We're deploying the official Docker image of Jira (v8) into AWS ECS, but I'm having trouble finding a way to manage the index files - every time the ECS tasks restarts we lose our index files and have to manually reindex.
We use NFS volumes to store persistent data (attachments, etc), but the latency on this proved far too high to hold the indexes, so they just live in the docker container.
The trouble comes when ECS decides to rebuild our container (e.g because a Jira update is available, often just because it feels like it). The container is destroyed, along with the index files, and I have to manually reindex. Our instance is still quite small so it doesn't take long, but it's a manual step in an otherwise fully automated process.
Since our Jira container always runs on the same ECS host I've tried mounting the index directory (/var/atlassian/application-data/caches/indexesV1) in a shared docker volume so it persists between ECS tasks. This led to a permissions error, so I'm assuming Docker is creating the Jira home directory early on, before Jira starts, with the wrong permissions.
JIRA couldn't create the jira.home directory. Ensure JIRA has permission to create and write to the jira.home directory /var/atlassian/application-data/jira.
I'd rather not write our own Docker image, or need an external script to trigger a reindex. I feel like there's a more elegant solution to this that I'm missing.