Docker, volumes and detecting file changes

I do have some file manipulation script (mostly Python + unoconv + pdftk), whose purpose is to create one PDF file from whatever files are deposited into a folder. Pyinotify is used to detect file changes inside the tree. Now I would like to marry this script with Nextcloud (docker, swarm mode). My initial idea was to use occ files:scan from the Python script. Buuut, it’s Docker. What would be the best way to go?


  • Is calling occ files:scan on every file change appropriate (with or without Docker)?
  • Local external storage?
  • Permissions! should everything be 33:33?


docker volume ls
local               nextcloud_config
local               nextcloud_data
local               nextcloud_html
local               nextcloud_mysql

docker service ls
ID                  NAME                    MODE                REPLICAS            IMAGE                          PORTS
i82bhd7sj6c6        nextcloud_cache         replicated          1/1                 redis:4.0
qziudyzotdwn        nextcloud_db            replicated          1/1                 mariadb:10
dd6grjk5xkww        nextcloud_web           replicated          1/1                 nextcloud:14.0-apache


  • I haven’t dockerized the script yet.
  • Userbase is something like 100 users, 10 groups. PDF files are supposed to pop inside group shares.

Current toughts

All I can come up with is to build a custom Nextcloud image with an added layer of Python, Pyinotify, another script… or while I’m at it, why not add unoconv, pdftk and minesweeper and everything in the shaker? but it doesn’t smell right.