nginx assets location
See original GitHub issuein the docker-compose.yml
there is this entry:
erpnext-nginx:
image: frappe/erpnext-nginx:${ERPNEXT_VERSION}
... rest
volumes:
- sites-vol:/var/www/html/sites:rw
- assets-vol:/assets:rw
is there a particular reason why - assets-vol:/assets:rw
is not pointing to - assets-vol:/var/www/html/assets:rw
.
from what i can observe both /assets
and /var/www/html/assets
contains the same files, the only difference is that /assets
is declared as a volume in the Dockerfile
for nginx.
reason i am asking is because if i add a file inside the nginx container under /var/www/html/assets/hello-world.js
, then i can access it via http://mysite/assets/hello-world.js
.
yet, if i add the file under /assets/hello-world.js
, then it doesn’t get served via http://mysite/assets/hello-world.js
.
i presume that is because of this nginx config:
server {
listen 80;
server_name $http_host;
root /var/www/html;
location /assets {
try_files $uri =404;
}
}
just not sure what the point is of having /assets
as a volume if it isn’t going to get served by nginx
Issue Analytics
- State:
- Created 2 years ago
- Comments:11
Top GitHub Comments
to ensure assets are always served from container/origin, instead of cache
worker image needs assets at location /home/frappe/frappe-bench/sites/assets
on entry point of nginx image, all assets from nginx image are copied to common volume.
https://github.com/frappe/frappe_docker/blob/33ec8cafc381af2725f21b3f7c0cbb1cd504e904/build/frappe-nginx/docker-entrypoint.sh#L7