|
1 |
| -# Docker Magento |
| 1 | +# Docker Magento 2 |
2 | 2 |
|
3 | 3 | ```Rootless containers```,
|
4 | 4 | ```Docker```,
|
5 |
| -```Magento```, |
| 5 | +```Magento 2```, |
6 | 6 | ```Nginx```,
|
7 | 7 | ```MySQL```,
|
8 | 8 | ```PHP-FPM```,
|
|
13 | 13 | ```Elastic Search```,
|
14 | 14 | ```Kibana```
|
15 | 15 |
|
| 16 | +## Currently supported versions of Magento |
| 17 | + |
| 18 | +- 2.4.x |
| 19 | + |
16 | 20 | ## Setup
|
17 | 21 |
|
18 |
| -__1) Add following to etc/hosts__ |
| 22 | +__Add following to etc/hosts__ |
19 | 23 | - 127.0.0.1 magento.local
|
20 | 24 | - 127.0.0.1 kibana.magento.local
|
21 | 25 | - 127.0.0.1 redis.magento.local
|
22 | 26 | - 127.0.0.1 rabbitmq.magento.local
|
23 | 27 | - 127.0.0.1 adminer.magento.local
|
24 | 28 |
|
25 |
| -__2) Start Docker__ |
26 |
| - |
27 |
| -- ```sh bin/start.sh``` |
28 |
| - - Accepts additional arguments (--build <container>) |
29 |
| - |
30 |
| -__3) Create new or add existing Magento project__ |
31 |
| - |
32 |
| -- Create new project |
33 |
| - - ```sh bin/new-project.sh``` |
34 |
| - - Keys can be found in https://marketplace.magento.com/customer/accessKeys/ |
35 |
| - |
36 |
| -- Add existing project |
| 29 | +__A) Create brand new Magento project__ |
| 30 | + |
| 31 | +1) Run ```sh bin/new-project.sh <version>``` |
| 32 | + - Requires Magento version as an argument |
| 33 | + - Make sure "magento" folder exists and is owned by current user before you bind it to the container by running the script above, otherwise it will be created by Docker and owned by root. |
| 34 | + - Keys can be found in https://marketplace.magento.com/customer/accessKeys/ and you can opt-in to store your keys (login and password) to /home/docker/.composer/auth.json, which is bind mounted to docker/php-fpm/auth.json |
| 35 | + - Magento default settings - these can be edited in bin/new-project.sh |
| 36 | + - base-url=http://magento.local |
| 37 | + - db-host=mysql |
| 38 | + - db-name=magento |
| 39 | + - db-user=magento |
| 40 | + - db-password=magento |
| 41 | + - admin-firstname=admin |
| 42 | + - admin-lastname=admin |
| 43 | + |
| 44 | + - admin-user=admin |
| 45 | + - admin-password=admin123 |
| 46 | + - language=en_US |
| 47 | + - currency=USD |
| 48 | + - timezone=America/Chicago |
| 49 | + - use-rewrites=1 |
| 50 | + - elasticsearch-host=elasticsearch |
| 51 | + - session-save=redis |
| 52 | + - session-save-redis-host=redis |
| 53 | + - session-save-redis-db=0 --session-save-redis-password="" |
| 54 | + - cache-backend=redis |
| 55 | + - cache-backend-redis-server=redis |
| 56 | + - cache-backend-redis-db=1 |
| 57 | + - page-cache=redis |
| 58 | + - page-cache-redis-server=redis |
| 59 | + - page-cache-redis-db=2 |
| 60 | + - amqp-host="rabbitmq" |
| 61 | + - amqp-port="5672" |
| 62 | + - amqp-user="guest" |
| 63 | + - amqp-password="guest" |
| 64 | + - amqp-virtualhost="/" |
| 65 | + |
| 66 | +__B) Run already existing Magento project__ |
| 67 | + |
| 68 | +1) Run ```sh bin/start.sh``` |
| 69 | + |
| 70 | +2) Add existing project |
37 | 71 | - Paste your existing Magento project to magento folder
|
38 | 72 |
|
39 |
| -__4) Install Magento__ |
40 |
| - |
41 |
| -- ```sh bin/install.sh``` |
42 |
| - |
43 |
| -__5) Setup Xdebug in IDE__ |
| 73 | +__Setup Xdebug in IDE__ |
44 | 74 |
|
45 |
| -- PhpStorm should offer you automatic setup after you add breakpoint and make http request (open magento.local in a browser) and correct settings should be similar to this: |
| 75 | +1) Run ```sh bin/xdebug.sh debug``` |
| 76 | + - You can turn off Xdebug by running ```sh bin/xdebug.sh off``` and turn it on again with ```sh bin/xdebug.sh debug```, you can also use this command to set all other Xdebug modes (https://xdebug.org/docs/all_settings#mode) |
| 77 | +2) PhpStorm should offer you automatic setup after you add breakpoint and make http request (open magento.local in a browser) and correct settings should be similar to this: |
46 | 78 |
|
47 | 79 | Preferences - PHP - Debug
|
48 | 80 |
|
|
0 commit comments