No, if you log in through the Docker console you are root, by typing in "su $USER" you are changing to the real user for the application itself so that it creates the file where it should be.
Tested it now on my own, you are completely correct, doesn't work when the directory doesn't exist, have changed the post to create the directory first, thank you for the heads up.
To be honest, I don't built any functionality into this container so that the application can run as root for security reasons (very few of my container have this ability to run as root eg: Krusader, luckyBackup).