-
Notifications
You must be signed in to change notification settings - Fork 253
Description
First I'd like to pay a compliment to the very well put together Docker base image you've created. Nicely done, and thank you.
Regarding /usr/share/nginx/html, as the web root directory, though this may sound very pedantic, I wanted to point out a bit of history informing the choice of web root paths, which are typically /var/www in most Linux distributions, including Debian. In contrast, this project uses /usr/share/nginx/html, the Nginx package's installed location for default HTML files.
In the 1994 Filesystem Hierarchy Standard[0] (The "standard guidelines for file and directory placement under UNIX-like operating systems"), it's noted that:
/var contains variable data files [...] /var is specified here in order to make it possible to mount /usr read-only. Everything that once went into /usr that is written to during system operation (as opposed to installation and software maintenance) must be in /var.
However, note that Nginx does correctly use /usr/share as the location to place it's "read-only" package installed data/sample files.[1]
Any program or package which contains or requires data that doesn't need to be modified should store that data in /usr/share. [...] It is recommended that a subdirectory be used in /usr/share for this purpose.
The FHS Standard makes this example for games:
Game data stored in /usr/share/games must be purely static data. Any modifiable files, such as score files, game play logs, and so forth, should be placed in /var/games.
An insightful discussion can be found on StackOverflow[2].
[0] https://www.pathname.com/fhs/pub/fhs-2.3.html#PURPOSE31
[1] https://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREARCHITECTUREINDEPENDENTDATA
[2] https://unix.stackexchange.com/questions/47436/why-is-the-root-directory-on-a-web-server-put-by-default-in-var-www