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

Added instructions for running composer using docker #6481

Merged
Merged
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
13 changes: 13 additions & 0 deletions src/cloud/docker/docker-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ Use the following command to stop and remove the Docker configuration:
{: .bs-callout-warning}
This command removes all components of your local Docker instance including containers, networks, volumes, and images except for the persistent database and the `magento-sync` volume. See [Rebuild a clean environment][refresh].

## Running Composer with Docker

It is possible to run composer using `docker` before you have instanced the containers. This is very useful for instancing the application during the CI/CD build process, or even first time Magento set up.
Copy link
Contributor

@meker12 meker12 Jan 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It is possible to run composer using `docker` before you have instanced the containers. This is very useful for instancing the application during the CI/CD build process, or even first time Magento set up.
You can run composer using `docker` commands before you create the containers. This technique is useful for creating an application instance during the CI/CD build process, or even for first time Magento set up.


When you run composer with Docker commands, you must use the [Docker Hub PHP Image Tag] that matches the Magento application version. The following example uses PHP 7.3. You run this command from the project root directory.

```bash
docker run -it -v $(pwd):/app/ -v ~/.composer/:/root/.composer/ magento/magento-cloud-docker-php:7.3-cli-1.1 bash -c "composer install&&chown www. /app/"
```

This command passes in the current working directory as `/app/`, includes composer from `~/.composer/`, and runs the `composer install` command in the container. After this set up, the command fixes the permissions on the files that have been added or changed.

## Sendmail service

Send emails from your Docker environment by adding the following configuration to the `docker-compose.yml` configuration file:
Expand All @@ -111,3 +123,4 @@ We do not recommend using Sendmail on CLI containers because the service can slo
[enable Xdebug]: {{site.baseurl}}/cloud/docker/docker-development-debug.html
[Database container]: {{site.baseurl}}/cloud/docker/docker-containers-service.html#database-container
[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