replace websocketd by pipes
As described here https://stackoverflow.com/questions/32163955/how-to-run-shell-script-on-host-from-docker-container plus an output pipe for the content instead of a simple file ie something like on host:
$ mkfifo pipe/command_pipe
$ mkfifo pipe/out_pipe
$ while true; do eval "$(cat pipe/command_pipe)" &> pipe/output_pipe; done
and in docker image:
$ tail -f pipe/out_pipe &
$ echo "ls -l" > pipe/command_pipe
Obviously, reuse the websocketd-server.py instead of a simple eval "$(cat .."
Edited by leolivier