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

MCLOUD-2361: OOTB Docker Initialization #7345

Merged
merged 7 commits into from
Jun 5, 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
46 changes: 17 additions & 29 deletions src/cloud/docker/docker-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,16 @@ The `ece-docker build:compose` command overwrites the existing `docker-compose.y

## Prerequisites

1. You must have the following software installed on your local workstation:
- [PHP version 7.1 or later][php]
- [Composer]
- [Docker]
- On MacOS and Windows, file synchronization is required for developer mode—use one of the following:
- [docker-sync]
- [mutagen]
To get started with local development you must have [Docker] installed on your workstation. In addition, macOS and Windows systems require either [docker-sync] or [Mutagen] for file synchronization between the host and Docker environments.

1. Update the hosts file.
### Optional Steps

Before you begin, you must add the following hostname to your `/etc/hosts` file:
Magento Cloud Docker binds to port `80` on your host environment. If you have enabled the bundled web server on your workstation you must stop the service before launching the Docker environment.

```conf
127.0.0.1 magento2.docker
```

Alternatively, you can run the following command to add it to the file:

```bash
echo "127.0.0.1 magento2.docker" | sudo tee -a /etc/hosts
```

{:.bs-callout-tip}
To change the `magento2.docker` hostname for your project, you must update the host in three files: `.docker/config.php`, `docker-compose.yml`, and `/etc/hosts`

1. Stop the default Apache instance on macOS.

Because macOS provides built-in Apache service, and may occupy port `80`, you must stop the service with the following command:

```bash
sudo apachectl stop
```
```bash
sudo apachectl stop
```

## Set the launch mode

Expand Down Expand Up @@ -112,7 +90,17 @@ To configure the custom host and port, add the `host` and `port` options to the
./vendor/bin/ece-docker build:compose --host=magento2.test --port=8080
```

You must also add the custom hostname to your `/etc/hosts` file.
You must also add or update the custom host name in your `/etc/hosts` file.

```conf
127.0.0.1 magento2.test
```

Alternatively, you can run the following command to add it to the file:

```bash
echo "127.0.0.1 magento2.test" | sudo tee -a /etc/hosts
```

## Set up email

Expand Down
10 changes: 8 additions & 2 deletions src/cloud/docker/docker-mode-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ To launch the Docker environment in developer mode:

1. Add your [Magento access credentials][magento-creds] to the `auth.json` file.

1. Install the template dependencies.
1. To install the template dependencies, and add the default hostname to your `/etc/hosts` file, run the following command:

```bash
composer install
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash
```

If you need to customize some aspect of initializing your environment, see the possible options `init-docker.sh` supports:

```bash
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash -s -- --help
```

1. On macOS or Windows hosts, install the selected file synchronization tool:
Expand Down
10 changes: 8 additions & 2 deletions src/cloud/docker/docker-mode-production.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ To launch the Docker environment in production mode:

1. Add your [Magento access credentials][magento-creds] to the `auth.json` file.

1. Install the template dependencies.
1. To install the template dependencies and add the default hostname to your `/etc/hosts` file, use the following command to run the Docker initialization script:

```bash
composer install
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash
```

If required, you can add options to the `init-docker.sh` initialization script to customize your Docker environment. Run the following command to see the available options:

```bash
curl https://raw.githubusercontent.com/magento/magento-cloud-docker/1.1.0/bin/init-docker.sh | bash -s -- --help
```

1. In your local environment, start the Docker configuration generator. You can use the service keys, such as `--php`, to [specify a version][services].
Expand Down