Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Updated Cloud Docker container info and clean up markdown #8216

Merged
merged 12 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/_includes/cloud/cloud-docker-config-generator-cmds.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ php ./vendor/bin/ece-docker list
```

{:.bs-callout-info}
The `ece-docker build:compose` command runs in interactive mode and verifies the configured service versions. To skip interactive mode, use the `-n, --no-interaction` option.
The `ece-docker build:compose` command runs in interactive mode and verifies the configured service versions. To skip interactive mode, use the `-n, --no-interaction` option. For more information about `ece-docker build:compose` command options, see [Service configuration options]({{site.baseurl}}/cloud/docker/docker-containers.html#service-configuration-options).
19 changes: 2 additions & 17 deletions src/cloud/docker/docker-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,7 @@ echo "127.0.0.1 magento2.test" | sudo tee -a /etc/hosts

## Set up email

The default {{ site.data.var.mcd-prod }} configuration includes the [MailHog] service as a replacement for the Sendmail service. Sendmail can cause performance issues in the local Docker environment.

When the MailHog service is installed, go to the following URL to open the service and view outgoing emails: `http://magento2.docker:8025`

By default, MailHog listens on port 1025 for SMTP and port 8025 for the frontend dashboard and API. You can change the default ports using the `--mailhog-http-port` and `--mailhog-smtp-port` options.

```bash
./vendor/bin/ece-docker build:compose --mailhog-smtp-port=1026 --mailhog-http-port=8026
```

After updating the configuration and restarting the Docker environment, you can connect to the MailHog service from `http://magento2.docker:8026`, and use port 1026 for SMTP communication.

If you do not need the [MailHog] service, use the `--no-mailhog` option to generate the Docker compose configuration:

```bash
./vendor/bin/ece-docker build:compose --no-mailhog
```
The default {{ site.data.var.mcd-prod }} configuration includes the [MailHog] service as a replacement for the Sendmail service. Sendmail can cause performance issues in the local Docker environment. See [MailHog service].

[php]: https://www.php.net/manual/en/install.php
[Composer]: https://getcomposer.org
Expand All @@ -161,3 +145,4 @@ If you do not need the [MailHog] service, use the `--no-mailhog` option to gener
[refresh]: {{site.baseurl}}/cloud/docker/docker-containers.html#rebuild-a-clean-environment
[Docker Hub PHP Image Tag]: https://hub.docker.com/r/magento/magento-cloud-docker-php/tags
[MailHog]: https://github.com/mailhog/MailHog
[MailHog service]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#mailhog-container
13 changes: 11 additions & 2 deletions src/cloud/docker/docker-containers-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ docker-compose run --rm build magento-command setup:static-content:deploy

The Cron container runs operations in the background immediately after the Docker environment starts. This container uses the cron configuration defined in the [`crons` property of the `.magento.app.yaml` file]({{ site.baseurl }}/cloud/project/magento-app-properties.html#crons). This container has no custom configuration.

{:.bs-callout-info}
To improve overall performance in the local Docker environment, the Cron container is not present by default. You can use the following command to add the Cron container to the Cloud Docker environment: `./vendor/bin/ece-docker build:compose --mode="developer" --with-cron`

For details on managing cron jobs in the Cloud Docker environment, see [Manage cron jobs].

## Deploy container

**Container name**: deploy<br/>
Docker base image: [magento/magento-cloud-docker-php], which is based on the [php] Docker image<br/>
**Docker base image**: [magento/magento-cloud-docker-php], which is based on the [php] Docker image<br/>

The Deploy container mimics the Magento Cloud deploy process so that testing the build and deploy process is as close to testing in production as possible.

Expand All @@ -90,6 +93,12 @@ docker-compose run --rm deploy magento-command index:reindex

The Node container is based on the [official Node Docker image][node]. You can use the container to install NPM dependencies, such as Gulp, or run any Node-based command line tools.

To add the Node container to the Docker environment, you must specify the Node version to install:

```bash
./vendor/bin/ece-docker build:compose --node <version>
```

[PHP-CLI version 7 image]: https://hub.docker.com/r/magento/magento-cloud-docker-php
[magento/magento-cloud-docker-php]: https://hub.docker.com/r/magento/magento-cloud-docker-php
[scripts]: https://github.com/magento/magento-cloud-docker/tree/develop/images/php/cli/bin
Expand All @@ -98,4 +107,4 @@ The Node container is based on the [official Node Docker image][node]. You can u
[php]: https://hub.docker.com/_/php
[node]: https://hub.docker.com/_/node
[Manage cron jobs]: {{site.baseurl}}/cloud/docker/docker-manage-cron-jobs.html
[ece-tools CLI]: {{site.baseurl}}/cloud/reference/ece-tools-reference.html
[ece-tools CLI commands]: {{site.baseurl}}/cloud/reference/ece-tools-reference.html
45 changes: 38 additions & 7 deletions src/cloud/docker/docker-containers-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Use the `--es-env-var` option to customize the Elasticsearch container when you
php vendor/bin/ece-docker build:compose --es-env-var=ES_JAVA_OPTS="-Xms512m -Xmx512m" --es-env-var=node.store.allow_mmapfs=false
```

See [Important Elasticsearch configuration][] in the Elasticsearch documentation for details about available configuration options.
See [Important Elasticsearch configuration] in the Elasticsearch documentation for details about available configuration options.

{:.bs-callout-info}
If your Cloud project uses Magento version 2.3.5 or earlier with MySQL search, add the `--no-es` option to skip the Elasticsearch container configuration when you generate the Docker Compose configuration file: `ece-docker build:compose --no-es`.
Expand Down Expand Up @@ -150,7 +150,29 @@ If you use the `docker-sync` or `mutagen` file synchronization options, the `php

You can add custom PHP extensions and manage their status from the `runtime` section of the `.magento.app.yaml` file. See [PHP extensions]. To test custom extensions without updating the {{site.data.var.ece}} environment configuration, you can add the custom configuration to the [`docker-compose.override.yml`][Docker override file]. Configuration settings in this file are applied only when you build and deploy to the Docker environment.

Optionally, you can add Xdebug to your Cloud Docker environment to debug your PHP code. See [Configure XDebug for Docker][].
Optionally, you can add Xdebug to your Cloud Docker environment to debug your PHP code. See [Configure XDebug for Docker].

## MailHog container

**Container name**: mailhog<br/>
**Docker base image**: [mailhog]<br/>
**Ports**: SMTP:`1025`, HTTP:`8025`

The default Magento Cloud Docker configuration includes the MailHog service as a replacement for the Sendmail service. Sendmail can cause performance issues in the local Docker environment.

By default, MailHog listens on port 1025 for SMTP and port 8025 for the frontend dashboard and API (HTTP). You can change the default ports using the `--mailhog-http-port` and `--mailhog-smtp-port` options. When you build the Docker compose configuration, you can change the default ports:

```bash
./vendor/bin/ece-docker build:compose --mailhog-smtp-port=1026 --mailhog-http-port=8026
```

After updating the configuration and restarting the Docker environment, you can connect to the MailHog service from `http://magento2.docker:8026`, and use port 1026 for SMTP communication.

If needed, you can disable the MailHog service when you generate the Docker compose configuration:

```bash
./vendor/bin/ece-docker build:compose --no-mailhog
```

## RabbitMQ container

Expand Down Expand Up @@ -193,11 +215,19 @@ The Test container, based on the [magento/magento-cloud-docker-php][php-cloud] D
## TLS container

**Container name**: tls<br/>
**Docker base image**: [magento/magento-cloud-docker-tls][tls], based on the [debian:jessie](https://hub.docker.com/_/debian) Docker image<br/>
**Ports exposed**: `443`</br>
**Docker base image**: [magento/magento-cloud-docker-nginx:1.19-1.2.0][tls]<br>
**Ports**: `443` (default), `8080:80` (Varnish bypass)<br/>

The TLS termination proxy container facilitates the Varnish SSL termination over HTTPS.

- The default port for TLS communication is `443`.
- If you have Varnish installed in the Docker environment, use port `8080:80` to bypass caching.
- You can change the default port when you generate the Docker configuration file:

```bash
./vendor/bin/ece-docker build:compose --tls-port <port-number>
```

To increase the timeout on this container, add the following code to the `docker-compose.override.yml` file:

```yaml
Expand All @@ -210,7 +240,6 @@ To increase the timeout on this container, add the following code to the `docke

**Container name**: varnish<br/>
**Docker base image**: [magento/magento-cloud-docker-varnish][varnish], based on the [centos] Docker image<br>
**Ports exposed**: `80`<br/>

The Varnish container simulates Fastly and is useful for testing VCL snippets.

Expand All @@ -219,7 +248,7 @@ The **Varnish** service is installed by default. When deployment completes, Mage
In some cases, you might require a Docker environment without Varnish, for example to debug or run performance tests. You can generate the Docker Compose configuration without Varnish by adding the `--no-varnish` option to the `ece-docker build:compose` command.

```bash
./vendor/bin/ece-docker build:compose --mode="developer" --php 7.2 --no-varnish
./vendor/bin/ece-docker build:compose --mode="developer" --php <version> --no-varnish
```

You can specify `VARNISHD_PARAMS` and other environment variables using ENV to specify custom values for required parameters. This is usually done by adding the configuration to the `docker-compose.override.yml` file.
Expand Down Expand Up @@ -280,6 +309,8 @@ To mount the custom index.php file using volumes:
[Docker override file]: https://docs.docker.com/compose/extends/
[FPM]: https://php-fpm.org
[Important Elasticsearch configuration]: https://www.elastic.co/guide/en/elasticsearch/reference/6.5/important-settings.html
[mailhog]: https://hub.docker.com/u/mailhog
[MailHog service]: https://github.com/mailhog/MailHog
[Manage the database]: {{site.baseurl}}/cloud/docker/docker-manage-database.html
[mariadb Docker documentation]: https://hub.docker.com/_/mariadb
[mariadb]: https://hub.docker.com/_/mariadb
Expand All @@ -291,7 +322,7 @@ To mount the custom index.php file using volumes:
[rabbitmq]: https://hub.docker.com/_/rabbitmq
[redis]: https://hub.docker.com/_/redis
[Service configuration options]: {{site.baseurl}}/cloud/docker/docker-containers.html#service-configuration-options
[tls]: https://hub.docker.com/r/magento/magento-cloud-docker-tls
[tls]: https://hub.docker.com/r/magento/magento-cloud-docker-nginx
[varnish]: https://hub.docker.com/r/magento/magento-cloud-docker-varnish
[varnish]: https://hub.docker.com/r/magento/magento-cloud-docker-varnish
[web config]: https://github.com/magento/docker
28 changes: 18 additions & 10 deletions src/cloud/docker/docker-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ The [`{{site.data.var.mcd-package}}` repository][docker-repo] contains build inf

The following CLI containers, most of which are based on a PHP-CLI version 7 Docker image, provide `magento-cloud` and `ece-tools` commands to perform file system operations and interact with the application:

| Name | Service | Key | Available Versions | Notes
{: .docker-cli-container-table}
| Name | Service | Key & options | Available Versions | Notes
| ------------- | ---------- | ---------- | ------------------ |------------------
| [build] | Build Container | none | none | PHP Container, runs build process
| [deploy] | Deploy Container | none | none | PHP Container, runs the deploy process
| [cron]| Cron Jobs | none | none | PHP Container, runs cron tasks
| [node][node-container] | Node | `--node` | 6, 8, 10, 11 | Used gulp or other NPM based commands
| [cron]| Cron Jobs | `--with-cron` | none | Optional PHP Container runs cron tasks
| [node][node-container] | Node | `--node` | 6, 8, 10, 11 | Optional Node container used for gulp or other NPM-based commands

See [Docker CLI containers] for details.

Expand All @@ -44,15 +45,17 @@ The following table shows the options to customize service container configurati
| ------------- | ---------- | ---------- | ------------------ |------------------
| [db] | MariaDB or MySQL<br> | `--db`, `--db-image` (MySQL)<br>`--expose-db-port`<br>`--db-increment`<br>`--db-offset`<br>`--with-entrypoint`<br>`--with-mariadb-config`|10.0, 10.1, 10.2<br>5.6, 5.7 | Use the increment and offset options to customize the [auto-increment settings][Using AUTO_INCREMENT] for replication.<br><br>Use the `--with-entrypoint` and `--with-mariadb-config` options to automatically configure database directories in the Docker environment<br><br>*Example build commands:*<br>`ece-docker build:compose --db <mariadb-version>`<br>`ece-docker build:compose --db <mysql-version> --db-image`
| [elasticsearch] | Elasticsearch | `--es`<br>`--es-env-var`<br>`--no-es` | 1.7, 2.4, 5.2, 6.5, 6.8, 7.5, 7.6, 7.7 | Use the options to specify the Elasticsearch version, customize Elasticsearch configuration options, or to build a Docker environment without Elasticsearch.
| [FPM][fpm-container] | PHP FPM | `--php`<br>`--with-xdebug` | 7.0, 7.1, 7.2, 7.3, 7.4 | Used for all incoming requests. Optionally, add Xdebug configuration to debug PHP code in the Docker environment.
| [node][node-container] | Node | `--node` | 6, 8, 10, 11 | Used gulp or other NPM based commands
| [rabbitmq][rabbitmq-container]| RabbitMQ | `--rmq` | 3.5, 3.7, 3.8 |
| [fpm][fpm-container] | PHP FPM | `--php`<br>`--with-xdebug` | 7.0, 7.1, 7.2, 7.3, 7.4 | Used for all incoming requests. Optionally, install a specific php version or add Xdebug to debug PHP code in the Docker environment.
| [fpm_xdebug][fpm_xdebug-container] | Xdebug | `--set-docker-host` | latest | Optional container for PHP debugging<br>On Linux systems, `--set-docker-host` sets the `.host.docker.internal` value in the container `/etc/hosts` file.
| [mailhog][mailhog-container] | MailHog | `--no-mailhog`<br>`--mailhog-http-port`<br>`--mailhog-smtp-port` | latest | Email service to replace Sendmail service, which can cause issues in Docker environment
| [node][node-container] | Node | `--node` | 6, 8, 10, 11 | Node container to run gulp or other NPM based commands in the Docker environment. Use the `--node` option to install a specific node version.
| [rabbitmq][rabbitmq-container]| RabbitMQ | `--rmq` | 3.5, 3.7, 3.8 | Use the `--rmq` option to install a specific RabbitMQ version.
| [redis][redis-container] | Redis | `--redis` | 3.2, 4.0, 5.0 | Standard redis container
| [selenium][selenium-container]| Selenium | `--with-selenium`<br>`--selenium-version`<br>`--selenium-image`| Any | Enables Magento application testing using the Magento Functional Testing Framework (MFTF)
| [test][test-container]| PHP CLI | `--with-test`| Any | Container with a writable file system for running tests
| [tls][tls-container] | SSL Endpoint | | | Terminates SSL, can be configured to pass to varnish or nginx
| [varnish][varnish-container] | Varnish | `--no-varnish` | 4, 6.2 | Varnish is provisioned by default. Use the `--no-varnish` option to skip Varnish service installation
| [web][web-container] | NGINX | `--nginx` | 1.9, latest |
| [test][test-container]| PHP CLI | `--with-test`| Any | Optional container with a writable file system for running tests
| [tls][tls-container] | SSL Endpoint | `--tls-port` | nginx 1.19-1.2.0, latest | Terminates SSL, can be configured to pass to varnish or nginx. Use the `--tls-port` option to change the default port (443).
| [varnish][varnish-container] | Varnish | `--no-varnish` | 4, 6.2 | Varnish is provisioned by default. Use the `--no-varnish` option to skip Varnish service installation.
| [web][web-container] | NGINX | `--nginx` | 1.19-1.2.0, latest | Use the `--nginx` option to install a specific nginx version.

Use the following command to view all available options for the `ece-docker build:compose` command:

Expand Down Expand Up @@ -153,9 +156,11 @@ Now you can see all requests that are passing through the TLS container and chec
[File Synchronization]: {{site.baseurl}}/cloud/docker/docker-syncing-data.html
[docker-repo]: https://github.com/magento/magento-cloud-docker
[nginx]: https://hub.docker.com/r/magento/magento-cloud-docker-nginx
[mailhog-container]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#mailhog-container
[node-container]: {{site.baseurl}}/cloud/docker/docker-containers-cli.html#node-container
[rabbitmq-container]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#rabbitmq-container
[fpm-container]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#fpm-container
[fpm_xdebug-container]: {{site.baseurl}}/cloud/docker/docker-development-debug.html
[redis-container]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#redis-container
[selenium-container]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#selenium-container
[test-container]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#test-container
Expand All @@ -174,3 +179,6 @@ Now you can see all requests that are passing through the TLS container and chec
table.docker-service-versions-table td:nth-child(3) {
width: 200px;
}
table.docker-cli-container-table td:nth-child(3) {
width: 200px;
}
39 changes: 22 additions & 17 deletions src/cloud/docker/docker-development-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,28 @@ If you use Microsoft Windows, take the following steps before continuing:
This command adds the Xdebug configuration to your `docker-compose.yml` file.

```yaml
fpm_xdebug:
hostname: fpm_xdebug.magento2.docker
image: 'magento/magento-cloud-docker-php:7.3-fpm-1.1'
extends: generic
ports:
- '9001:9001'
volumes:
- 'mymagento-magento-sync:/app:nocopy'
environment:
- 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip redis xsl sodium'
networks:
magento:
aliases:
- fpm_xdebug.magento2.docker
depends_on:
db:
condition: service_started
fpm_xdebug:
hostname: fpm_xdebug.magento2.docker
image: 'magento/magento-cloud-docker-php:7.4-fpm-1.2.0'
extends: generic
volumes:
- '.:/app:ro,delegated'
- 'magento-vendor:/app/vendor:ro,delegated'
- 'magento-generated:/app/generated:ro,delegated'
- 'magento-var:/app/var:rw,delegated'
- 'magento-app-etc:/app/app/etc:rw,delegated'
- 'magento-pub-media:/app/pub/media:rw,delegated'
- 'magento-pub-static:/app/pub/static:rw,delegated'
- '.docker/mnt:/mnt:rw,delegated'
environment:
- 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium xdebug'
networks:
magento:
aliases:
- fpm_xdebug.magento2.docker
depends_on:
db:
condition: service_started
```
{:.no-copy}

Expand Down
Loading