With a default number of workers set to 150, the example apache
configuration will use over 4GB of RAM in the following, rather
likely, demonstration scenario:
* sync a directory with 1000 photos in one directory from a desktop to
nextCloud
* go to the web interface and quickly scroll down to the bottom of the
list of photos that were just uploaded
* apache will run as many apache workers as possible (150) to create
thumbnails and use over 4GB of RAM
The default number of workers is reduced to 30 which has been
experienced to fit in a 2GB virtual machine. It takes longer to
complete but does not trigger out of memory problems.
In 18db7e679f the Dockerfile write
permissions were removed to help remind the new contributor that they
should not be modified. However git does not keep that information (it
only keeps the executable bit in the file permissions), therefore
someone with a fresh clone will not have a file that is read-only.
Removing the write permission will however be a problem for anyone
running the update.sh script twice: it will fail to remove the files
because it uses rm -r instead of rm -fr.
Instead of fixing the removale to use the force flag, we revert the
modification that remove the write permission since it does not
actually help anyone.
The `*/*/Dockerfile` are created from `Docker*template` by the
update.sh script. We add a comment at the beginning of the file with
information to find their origin. We also make them readonly to remind
people who would like to improve these files that they are not meant
to be modified.
Make container scripts posix compliant
Allows the scripts to run natively in the alpine container.
This allows us to remove the bash dependency of the alpine image, which saves about 6MB.