docker-symfony
docker-symfony copied to clipboard
Using ADD instead of volumes - Assets not found
Hi.
I am trying to ADD the application files to the PHP container instead of mounting them. The application files are added but while accessing it on the prod environment assets can not be found even after dumping them, fixing permissions errors and clearing the cache. Every request to an asset returns a 404 (Not Found), although they are in the container. It works fine in the dev environment tough. Maybe it is related to the nginx configurations but I don't really know.
So, what changes do I have to do in order to ADD instead of mounting volumes?
Hi! I just test assetics with volume. Everything works fine (I follow documentation). But when we switch to ADD, I've the same problem. NGINX&PHP consider /js/fsajkfla.js as a PHP file.
I'll dig in this direction: http://symfony.com/doc/current/setup/web_server_configuration.html Because my configuration is different from the Symfony one.
Stupid question, but why you don't want volume? It is for production mode?
Hi @maxpou. Yeah its for production.
Thank you.
The Api Platform (https://github.com/api-platform/api-platform) has a great docker setup with nginx and php fpm that can be used as reference. I wish I could help more but I'm still learning both docker and nginx.
Hi, I have the same problem. When I use ADD or COPY instead of volumes (for production images) the assets return 404. Have you found a solution? Thanks.
Hi @Miggianox94 , take a look at https://github.com/renan-taranto/symfony-dddocker. It may help you somehow.
Hi @renan-taranto i am having also the same issue. Did you find a solution ?
@Khaldoun488 I ended up not using this project boilerplate. Besides the resources I've already mentioned, this may help also: https://symfony.com/doc/current/setup/web_server_configuration.html#nginx
thanks
@renan-taranto are you using ECS for production ?