I have a host OS (Ubuntu) with ClamAV installed. and I am running a Docker container on this OS. This container is running a node web app that is publicly facing.
There is file upload functionality within this web app that uploads to a folder within the docker container.
This folder is "mounted" so that it is accessible from the host OS.
It needs to be scanned for viruses, then it needs to report back to the Docker container app with the results of the scan. These results will then be processed and relayed to the user.
What would be the best way to let the host OS know when a file has been uploaded to this folder?
The ways that have gone through my mind are:
Host OS polling the folder to check for changes (not desirable). The web app triggering some Docker "event" (or similar) to tell the host OS to scan a specific sub-folder (because the files will be uploaded to specific sub-folders and it won't be flat). A specific URL that is hit on the web app that then triggers something to happen on the host OS as it is listen in some way or other. No idea if any, or all these methods are achievable.