Using docker compose, index_mirror has not access to document data
I wasn't able to make index_mirror work in mayan 4.7 using docker compose for installation. The fuse filesystem is mounted on the container host, and is visible the directory structure of documents with correct filenames, times and sizes, but the files aren't readable.
Seems to me that the problem is that the container serving index_mirror has not access to the "mayan_app" volume. In docker-compose.yml the service "index_mirror" includes the "x-mayan-container" fragment, but having already a "volumes" key the mayan_app volume is not included.
For now I was able to make mirrors work explicitly adding "- ${MAYAN_APP_VOLUME:-app}:/var/lib/mayan
" in "index_mirror" service. The resulting service definition is this:
# Enable to run mirror an index.
index_mirror:
<<: [*mayan-container, *mayan-dependencies]
cap_add:
- SYS_ADMIN
devices:
- "/dev/fuse:/dev/fuse"
entrypoint:
- /bin/sh
- -c
- 'mkdir --parents /mnt/index && chown mayan:mayan /mnt/index && /usr/local/bin/entrypoint.sh run_command "mirroring_mount_index --allow-other ${MAYAN_MIRROR
_INDEX_NAME} /mnt/index-${MAYAN_MIRROR_INDEX_NAME}"'
profiles:
- index_mirror
security_opt:
- apparmor:unconfined
volumes:
- ${MAYAN_APP_VOLUME:-app}:/var/lib/mayan
- type: bind
# Location in the host where the index will show up.
# Must be created before enabling this profile.
# The Docker user must have access to this folder.
source: /mnt/mayan_indexes/${MAYAN_MIRROR_INDEX_NAME}
# Location inside the container where the index will be mounted.
target: /mnt/index-${MAYAN_MIRROR_INDEX_NAME}
bind:
propagation: shared