markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.58k stars 1.01k forks source link

unable to generate files in pub/static and pub/media after module installation #1183

Closed bhushanmeetanshi closed 3 months ago

bhushanmeetanshi commented 4 months ago

Description When i execute the command of bin/magento s:up command it will create file css and media files or user imports file of admin side or front end file. but with the docker of this magento 247 its not able to generated files. what to do?

Steps To Reproduce

  1. copy my vendor module folder in src/app/code directory
  2. execute bin/magento s:up command
  3. execute bin/magento s:s:d -f command
  4. execute bin/magento c:f command
  5. execute bin/magento s:d:c command

Expected Result Vendor Directory or any other files should be created after executing all above steps for pub/static folder and pub/media folder. for example css,csv, images etc. by the vendor module. but not created

Actual Result Not created any directory in /pub/media folder and pub/static folder in magento 247 docker in (ubuntu)

image image

bhushanmeetanshi commented 4 months ago

bin/fixperms ./var/www/html/pub/

@markshust i have also check and execute this command. but its not help ful for my scenario.

YevhenZvieriev commented 4 months ago

Hi, @bhushanmeetanshi

The pub folder doesn't sync due to performance reasons.

If you want, feel free to put the pub folder within the compose.dev.yaml file.

bin/copyfromcontainer pub should help you :)

bhushanmeetanshi commented 4 months ago

done thanks @YevhenZvieriev for your kind reply.. bin/copyfromcontainer pub it works !!

can you share the path? how can i put the path of this directory within the compose.dev.yaml file.?

bhushanmeetanshi commented 4 months ago

can i put like this @YevhenZvieriev ?

image

or can i put like this?

- ./pub:./src/pub

bhushanmeetanshi commented 4 months ago

if i install module then every time i have to execute this bin/copyfromcontainer pub command in magento docker???

bhushanmeetanshi commented 4 months ago

@YevhenZvieriev

for example below this urls:

URL with Pub: https://www.abc.com/pub/media/catalog/product/a/b/ab.jpg URL without Pub: https://www.abc.com/media/catalog/product/a/b/ab.jpg

i want to check directory created after generate csv from the backend then how can i check it using magento docker?

how can i specify path in compose.dev.yaml file?

YevhenZvieriev commented 4 months ago

Hi, @bhushanmeetanshi

if i install module then every time i have to execute this bin/copyfromcontainer pub command in magento docker???

If the pub folder is not synchronized, then indeed, this command will have to be run every time a new module is installed.

how can i specify path in compose.dev.yaml file?

To synchronize the pub folder, you need to add a corresponding entry to the volumes section for the services that require this synchronization. You need to add to the volumes section to synchronize the local ./src/pub folder with the /var/www/html/pub folder in the container. Now any changes made to the local ./src/pub folder will be reflected in the container and vice versa.

So, to specify the path for the pub folder in compose.dev.yaml just add the line - ./src/pub:/var/www/html/pub:cached to the volumes section.

If you have any more questions, I will be happy to help you :)

YevhenZvieriev commented 4 months ago

i want to check directory created after generate csv from the backend then how can i check it using magento docker?

Feel free to use the bin/bash script, it drops into the bash prompt of your Docker container.

bhushanmeetanshi commented 4 months ago

Thanks @YevhenZvieriev your answer is really helpful.. Thank you so much brother....

bhushanmeetanshi commented 3 months ago

@YevhenZvieriev this is not working for without sampledata magento and manual setup installation. I have implemented same steps as you mentioned in this thread.