Docker + Magento 2: Virtual Machine Tutorial

preview_player
Показать описание
Develop Magento 2 locally on Docker. In this video, I share with you the recipe for a Magento 2 + Docker VM that runs quickly and reliably. In fact, this has been my exact setup for almost 3 years now. You can easily add different components to it to replicate your production environment.

Рекомендации по теме
Комментарии
Автор

About time someone laid out a bare bones Docker/Magento scenario and alleviated my concerns of persistent storage. I'm all game for Docker becoming part of my flow but there's so many concerns to alleviate first.. I don't even want to start until I know there's going to be a clear workflow long term for quick dev, deployment & continued maintenance of my site.

CosyStudios
Автор

Hello,
That is very nice video that you have created

I have some queries
1. How to modify the files?
2. How to add new module?
3. How to access the Mysql?

chandanbhanopa
Автор

Hi how can I add an already existing Magento 2 into this? I have my Magento 2 project setup in Vagrant but there are plenty of drawback when using vagrant and I know docker is way better than vagrant. So how do I migrate it correctly? Hope to get a reply from you. Thanks

freshlybakedkamote
Автор

Thanks for sharing this useful information

davidvelasquez
Автор

I just finished installing but when I access the local server it gives me a 503. I can access phpmyadmin with no problems.

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

I installed with 7.4 changed ports to 8081 aside from that everything is the same with the guide. what could my problem be?

lofty-cove
Автор

Great tutorial!

Can I ask what the top level "volumes: db-data: external: false" entry in your docker-compose.yml was for? I'm new to Docker, but as far as I know as long as you add the volume "volume: db-data:/var/lib/mysql" in the mysql service, shouldn't the "db-data/" directory be created in your working directory regardless?

I'm just confused because I want to change the "mysql: volumes:" entry from

"volumes:
- db-data:/var/lib/mysql"

to

"volumes:
-

and I'm wondering if this is going to impact the top level "volumes" entry in the docker-compose.yml file.

Also, does webdevops/php-apache-dev:7.2 work with this project so I can use Magento 2.3.x?

matthewvolk
Автор

Thank you so much for sharing useful information. I have one question here. How can we add the existing database?

meghvankawala
Автор

I am trying to install Magento 2.4 with all the same configs except upgraded to webdevops/php-apache-dev:7.4 from ubuntu-16.04 as 2.4 requires recent version of PHP. And using the same MariaDb image from the tutorial.

I am able to access phpmyadmin in browser. However upon running set up, I get this:

"Current version of RDBMS is not supported. Used Version: 10.5.4-MariaDB-1:1
0.5.4+maria~focal. Supported versions: MySQL-8, MySQL-5.7, MariaDB-(10.2-10
.4) "

And when I explicitly state version for mariaDb to 10.2 or 10.4 in docker-compose.yml, I am not able to access phpmyadmin after build (docker-compose up -d --build ) succeeds.

Anything I maybe missing?

CalevChandraKavit
Автор

can i ask you how is the sync with the vendor folder ? As this folder is quite huge... did you encountered some issue with the sync... ?

phuongle
Автор

Is there a way to connect to the magento files (do changes) by using an SFTP client that would connect via SSH?

gnaniboy
Автор

Hola, trato de entrar pero tu pagina no tiene acceso

rosiibarra
Автор

2.2.3 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (7.3.6) does not satisfy that requirement.


How to get it to launch with a different php version (from a docker image?)?

whatsupbudbud
Автор

Doesn't work for latest version of Magento (Magento v2.3.0 supports PHP v7.1.3+). comes with PHP v7.0. Any help?

getsykot
Автор

After executing the last command to install the project, I am stuck with this error:
SQLSTATE[HY000] [2006] MySQL server has gone away
In InstallCommand.php line 264:
Parameter validation failed
Any idea how to fix this ? Thnx

atty
Автор

when i try to run php bin/magento sampledata:deploy I get this error: Could not open input file: bin/magento i Replace /path/to/magento on line 17 with the absolute path to the Magento files I downloaded like this:

karstendallsrensen
Автор

this will be so much better if every command was runnable on windows too

faranume
Автор

do we need to install php to run composer? php 7.1.x?

adisuns
Автор

I followed the steps but my localhost is not getting connected. docker setup is perfect as per steps. Also did host file entry. but still cant hit to localhost.
below is the yml file on windows.


services:
web:
image: webdevops/php-nginx:7.2
container_name: web
restart: always
#user: application
environment:
-
- WEB_DOCUMENT_ROOT=/app/pub
- PHP_DATE_TIMEZONE=EST
- PHP_DISPLAY_ERRORS=1
- PHP_MEMORY_LIMIT=2048M
- PHP_MAX_EXECUTION_TIME=300
- PHP_POST_MAX_SIZE=500M
-
volumes:
- ./:/app:cached
#ports:
# - "80:80"
# - "443:443"
# - "32823:22"
links:
- mysql
mysql:
image: mariadb:10
container_name: mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=magento
volumes:
- db-data:/var/lib/mysql
phpmyadmin:
container_name: phpmyadmin
restart: always
image: phpmyadmin/phpmyadmin:latest
environment:
- MYSQL_ROOT_PASSWORD=root
- PMA_USER=root
- PMA_PASSWORD=root
links:
- mysql:db
depends_on:
- mysql

volumes:
db-data:
external: false

adisuns
Автор

Update the above and this video after upgraded tag and release
or
append the following link

jdotsystem
welcome to shbcf.ru