Comments (3)
This has now been confirmed on multiple environments.
from docker-magento2.
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.
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:
- Document how to copy files locally (once on install to copy everything, then you'd need to run it fetch
var/generation
andvendor
folders anytime they may have been updated). We would then remove the mounting of./magento
and instead specifically mount./magento/app
. - 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 toappdata
via mounting./magento/app
.
Thoughts?
from docker-magento2.
Related Issues (20)
- It's great HOT 1
- PCNTL Sould be installed by default
- Database issues HOT 2
- generation folder is not in $MAGENTO_ROOT/var/ but $MAGENTO_ROOT/ HOT 2
- Extension name format for magento-extension-installer HOT 1
- [WINDOWS] The filesystem probably does not support all permission bits. If this is a FATfilesystem, you should set the "fat" option to true
- [WINDOWS] The filesystem probably does not support all permission bits. If this is a FATfilesystem, you should set the "fat" option to true
- theme install issues running CLI magento-commands
- class not found: MagentoHackathon\Composer\Magento\Plugin
- Rebuild PHP image HOT 2
- Documentation? What is the docker-compose-build.yml doing? HOT 1
- After Several days of use page load increases to 5+ minutes.
- What is the url for visiting the website? HOT 1
- Why there are no releases? HOT 1
- Missing extension ext-sockets for Magento 2.3.4 HOT 4
- SQLSTATE[HY000] [1045] Access denied for user HOT 3
- Could not delete /var/www/magento/vendor/composer/97287359/view/frontend/web/swagger-ui/js
- Magento 2.4 support ? HOT 1
- no access through localhost HOT 3
- Could not delete /var/www/magento/: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-magento2.