The goal:
Make newly created Laravel6 projects' bootstrap assets layout work from Docker.
Symptoms: Bootstrap assets work properly on local Laravel development environment (XAMPP -Apache- +Win10Pro), both the js and css are loaded well. But does'not work properly from local Docker (Win10-linux containers, Nginx+PHP+MySql+Redis), app.js and app.css runs on error 404.
Apache(local xampp):
Nginx(Docker):
What I did:
Virtual Host settings (httpd-vhosts.conf) for Apache in xampp:
Virtual Host settings (default.conf) for Nginx in nginx container:
.htaccess file in my projectfolder /a_new_app_for_test/public/
What settings should I add/change in order to make assets loaded correctly?
I suppose it could be related to nginx settings compiled into Docker.
Any help are appreciated.
Thanks in advance.
Try to copy your whole project to the container volume, this way nginx will be able to see your files from public or resources folder.
volumes:
- ./:/var/www/