Files not copied over into container
stavrosfa opened this issue · 5 comments
Firstly, I'd like to say that I am using "docker compose" instead of "docker-compose" (I ammended the Makefile), I am not sure that is the problem though.
After I run make build && make start, all the containers start ok, however the only files that are copied over are docker/dev/init-db.sql and the storage/mysql-data folder, resulting in a 404 from nginx (i am guessing because of the missing files).
I am running Linux Ubuntu 22.04, Docker 4.17.0, docker compose v2.16.0.
Any ideas on how to solve this would be greatly appreciated, thanks!
Hello
Please try to use next docker-compose.yml path mapping:
1)Nginx - ./:/var/www/html:ro,cached
2)Laravel - ./:/var/www/html:cached
And inform us if it helps
Hi, thanks for the swift response, but no, this doesn't seem to have any effect.
Although, I found that if I set
1)Nginx - ./:/var/www/html/random-folder:ro,cached
2)Laravel - ./:/var/www/html/random-folder:cached
then all the files are copied in the /html folder (supposedly correctly so + correct permissions according to Dockerfile, www-data:www-data) + html/random-folder/docker (root:root) + html/random-folder/mysql-data(root:root) in the Laravel container, but still the same as before in the nginx container (root:root).
I am not quite sure what to make of this, or how to get around it..
First of all please follow recommendations from the docker-compose Team - docker/compose#9814
Make sure that you don't have other changes on your local docker-nginx-php-laravel
Please provide more info about the error that you have now
I followed everything I could find, but the only thing that helped eventually was to go in Docker Desktop, in resources and manually add /var/www/html as a folder sharing location. This solved the problem of files not getting copied over.
I still can't run make composer-install (I can composer install inside the container) or make env-dev (but I can cp .env.dev .env inside the container). Even After I do that I get a 502 from Nginx. The permissions also don't seem to be correct, everything is root:root.
I run the same thing on my work mac and it just took 10 minutes to download everything but is working out of the box as intended. This has definitely something to do with Linux permissions, so I guess this issue can be closed as it was about file sharing between host and containers.
Please make sure that you are not logged in as a root user on your Linux. Try to create additional user and check once again.