I have a question, what is your local env configuration in Windows 10.
I tried to run magento2 on docker but it works very slow with the shared directory.
I know I can only share the "app" directory to speed things up.
But I wonder if there is a better approach to configuring dev env.
2
Answers
Running Magento2 on Windows is bit tricky, but it is doable. I personally use XAMPP + system services for ElasticSeach, RabbitMQ and MySQL. For dev env I do not use Varnish and Redis.
Supported versions for each service can be found in documentation here.
After you have installed all services mentioned above (required is ElasticSearch and DB – MySQl or MariaDB – other ones are optional), you need to install Magento. Simple installation can look like:
htdocs
folder in your xampp installationcomposer install
+bin/magento setup:install
or whatever you use)app/etc/di.xml
– findMagentoFrameworkAppViewAssetMaterializationStrategySymlink
and replace it withMagentoFrameworkAppViewAssetMaterializationStrategyCopy
MagentoFrameworkViewElementTemplateFileValidator::isPathInDirectories
$this->fileDriver->getRealPath($path)
withstr_replace('\', '/', $this->fileDriver->getRealPath($path));
MagentoFrameworkImageAdapterGd2::validateURLScheme
!file_exists($filename)
to this if statementAfter this, you should be able to use Magento 2 on Windows, but be aware there may be different issues as Windows is not supported officially (although I did not find any issue yet).
Maybe a bit OT, but if you have access to run your development on a Mac, you can use warden (https ://warden.dev) – its very easy to use and will run a full environment for you with all services.
It does filesync for the magento files, so you wont need to have it mounted to your machine’s local directory (removing the performance bottleneck).
Ram is the most important thing, so if you can get an older Intel based mac-mini, it’s actually a cost-effective solution.