docker-symfony icon indicating copy to clipboard operation
docker-symfony copied to clipboard

Using ADD instead of volumes - Assets not found

Open renan-taranto opened this issue 8 years ago • 9 comments

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?

renan-taranto avatar Feb 15 '17 15:02 renan-taranto

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?

maxpou avatar Feb 17 '17 13:02 maxpou

Hi @maxpou. Yeah its for production.

Thank you.

renan-taranto avatar Feb 17 '17 13:02 renan-taranto

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.

renan-taranto avatar Feb 17 '17 23:02 renan-taranto

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.

Miggianox94 avatar Jul 08 '18 10:07 Miggianox94

Hi @Miggianox94 , take a look at https://github.com/renan-taranto/symfony-dddocker. It may help you somehow.

renan-taranto avatar Jul 08 '18 20:07 renan-taranto

Hi @renan-taranto i am having also the same issue. Did you find a solution ?

Khaldoun488 avatar Oct 13 '18 00:10 Khaldoun488

@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

renan-taranto avatar Oct 13 '18 19:10 renan-taranto

thanks

Khaldoun488 avatar Oct 13 '18 22:10 Khaldoun488

@renan-taranto are you using ECS for production ?

Khaldoun488 avatar Oct 13 '18 23:10 Khaldoun488