[Docker] Restructure Docker/Docker-Compose setup
See original GitHub issueI find it really weird that you have to download a zip file with a structure of empty folders and some files. Usually the needed files are within the image and the folders would be created by the program itself.
This means that auth.js
; default.json
and encrypted.json
should be created upon the first container start if they don’t exist.
encrypted.json
and default.json
seem to serve the same purpose.
Or is there a specific reason that auth.js needs to be mounted outside the container?
It’s best practice to just show what volumes to map, what ports to forward and which environment variables to set in the Readme file, so there shouldn’t be the need to download an entire zip with file structure.
Furthermore, executables and zip files should be removed from the github repo long term.
Despite my suggestions, I really enjoy the work you have put into it 😃
Best regards.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
I was thinking about this yesterday, and I realized we don’t actually need to make any modifications anywhere to have the automatic folder creation work (so no mkdirs necessary).
Basically, if you set up a mount in the docker-compose.yml and the host-side folder doesn’t exist, it will autocreate one – this is the exact functionality we need! The container then correctly handles the empty folders (meaning config and db files get rightly made).
So for the next release (coming up in the next day or so) I’ll just have users use the docker-compose and nothing else. Once that’s done, I think everything else in this issue is addressed, so I’ll close this issue then.
Actually, if you only want to
mkdir
if the directory does not exist you need to put an!
in front of the -d flag. Like this:(And this does not need to be bash; any POSIX compliant shell will do; Arrays are a bash only feature, but they’re not needed in this case though.)