Git Product home page Git Product logo

Comments (3)

punkstar avatar punkstar commented on May 25, 2024

This has now been confirmed on multiple environments.

from docker-magento2.

ashsmith avatar ashsmith commented on May 25, 2024

I've experimented with not mounting the entire magento directory, which has worked pretty well so far. By not mounting Magento we no longer need to manage permissions which eliminates this issue completely.

To implement this, I modified by docker-compose.yml so that only my code is mounted (in my case it was the extensions dir of the meanbee/magento2-environment setup). I made sure /var/www/magento is defined as a volume on appdata to ensure the files persists. My current.env will then had UPDATE_UID_GID=false (I'd propose removing this functionality completely though of course).

We can use docker cp to copy the files locally so that they are available for our IDE. But, the problem is when new extensions are installed, or code written that depends on generated code (located in var/generation within the magento root), you would need to re-sync each time. We would also want the re-sync anytime composer dependencies change too.

I think using docker cp to copy the files is a good trade off, considering the performance benefit. However, it would be interesting to investigate the potential of other solutions like docker-unison, not sure if that's the right fit, but certainly worth trying (it doesn't need to be a 2 way sync imo, just getting the files from the container and keeping them up to date would be suitable)

Documentation would have to be updated for this across repo's (including the meanbee/magento2-environment), and other clients.

from docker-magento2.

ashsmith avatar ashsmith commented on May 25, 2024

Played around with unison, doesn't appear to solve the permission issue. I'm sure it makes file reading/writing faster. But permissions are incorrect which Magento whinges about. I fear we'll still run into slowness by resetting permissions, which is a pain when starting up our containers or running cli tools.

I'm left with two ideas:

  1. Document how to copy files locally (once on install to copy everything, then you'd need to run it fetch var/generation and vendor folders anytime they may have been updated). We would then remove the mounting of ./magento and instead specifically mount ./magento/app.
  2. Create an rsync container. It would attach to the appdata volume, and sync files from /var/www/magento to somewhere else in the container that can then be mounted. This way we receive updated files locally, and updated files locally are added to appdata via mounting ./magento/app.

Thoughts?

from docker-magento2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.