Open excalq opened 2 years ago
All that said, it's easy enough to just override the web root in one's own Nginx config, in a Dockerfile that extends this project's image:
FROM wyveo/nginx-php-fpm:php81
...
COPY . /var/www
COPY ./docker-files/nginx.conf /etc/nginx/conf.d/website.conf
RUN rm -rf /etc/nginx/conf.d/default.conf
Perhaps an example in the README.md
could illustrate this well. I'll be happy to contribute mine when it's ready. It also does npm install
and composer install
during the build. This would help resolve issue #40 as well.
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:
However, note that Nginx does correctly use
/usr/share
as the location to place it's "read-only" package installed data/sample files.[1]The FHS Standard makes this example for 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