Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ COMPOSE_PROJECT_NAME=YOUR_PROJECT_NAME
###########
COMPOSER_PROJECT_ENABLED=true

##########################################################################
# The repository that composer will use to create your magento project
# by default the value is the mage-OS (https://mage-os.org/) repository
###########
COMPOSER_PROJECT_REPO=https://mirror.mage-os.org/

##########################################################################
# The Composer Project to install. Note, that on certain PHP versions, the glob
# syntax does not work, so you may need to specify an exact version.
Expand Down
22 changes: 22 additions & 0 deletions docs/stories/composer/auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Setting up your Magento Account
[The process of creating a Magento account is fully documented by Magento and you should follow their process](https://docs.magento.com/m2/ce/user_guide/magento/magento-account-create.html).

### Configuring Composer
In case you have not done so, we will add your Magento composer authentication credentials to your user's local `auth.json`.

First check to see if you have a credentials file under `~/.composer/auth.json`.

```bash
cat ~/.composer/auth.json
```

If you have a `auth.json` file here, you have most likely already configured your credentials and can skip to the next step.

If you don't see your credentials there, [you can follow the Magento 2 guide to find your credentials](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html) and copy the `auth.json.sample` [found in the Magento 2 repo](https://github.com/magento/magento2/blob/2.4-develop/auth.json.sample) to your user's `auth.json` file: `~/.composer/auth.json` file and fill out the required credentials.

```bash
cp /path/to/magento/project/auth.json.sample ~/.composer/auth.json
```

### Per-project configuration
We recommend using `auth.json` in your user's directory, but when you're working on multiple Magento 2 applications at once, you may need multiple `auth.json`. You can simply add the `auth.json` to the root of your Magento 2 project after project creation, and composer will use those credentials instead.
30 changes: 7 additions & 23 deletions docs/stories/dolphin.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,6 @@ git clone https://www.github.com/graycoreio/mage2docker \
&& cd mage2docker
```

### Setting up your Magento Account
[The process of creating a Magento account is fully documented by Magento and you should follow their process](https://docs.magento.com/m2/ce/user_guide/magento/magento-account-create.html).

### Configuring Composer
In case you have not done so, we will add your Magento composer authentication credentials to your user's local `auth.json`.

First check to see if you have a credentials file under `~/.composer/auth.json`.

```bash
cat ~/.composer/auth.json
```

If you have a `auth.json` file here, you have most likely already configured your credentials and can skip to the next step.

If you don't see your credentials there, [you can follow the Magento 2 guide to find your credentials](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html) and copy the `auth.json.sample` [found in the Magento 2 repo](https://github.com/magento/magento2/blob/2.4-develop/auth.json.sample) to your user's `auth.json` file: `~/.composer/auth.json` file and fill out the required credentials.

```bash
cp /path/to/magento/project/auth.json.sample ~/.composer/auth.json
```

### Per-project configuration
We recommend using `auth.json` in your user's directory, but when you're working on multiple Magento 2 applications at once, you may need multiple `auth.json`. You can simply add the `auth.json` to the root of your Magento 2 project after project creation, and composer will use those credentials instead.

### Configuring Docker Compose
Mage2Docker comes with a basic environment configuration file `.env.sample`, you can utilize this file to tailor your environment to your needs.

Expand Down Expand Up @@ -72,6 +49,13 @@ If you're using [WSL2, use this instead.](https://github.com/microsoft/WSL/issue
* [Install Recommended Extensions](../../.vscode/extensions.json)
* [Install the devcontainer cli](https://code.visualstudio.com/docs/remote/devcontainer-cli)


### Magento Open Source and Adobe Commerce Only - Composer auth.json
By default this project uses [Mage-OS](https://mage-os.org/). To use Adobe's Magento Open Source or Adobe Commerce you will need to:
1. Follow [these steps](./composer/auth.md) to configure composer's `auth.json` with your Magento Account credentials.
2. Change the repository variable in `.env` file to `https://repo.magento.com/`
Comment thread
damienwebdev marked this conversation as resolved.
Outdated


### Start your environment
From your `mage2docker` repo:

Expand Down
2 changes: 1 addition & 1 deletion php/7.2/fpm-alpine-dolphin/bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ -f 'pub/index.php' ]; then
echo "Setup took: $((SETUP_END-SETUP_START)) seconds..."
exit 0;
elif [ "$COMPOSER_PROJECT_ENABLED" == true ]; then
composer create-project --no-install --repository-url=https://repo.magento.com/ $COMPOSER_PROJECT .
composer create-project --no-install --repository-url=$COMPOSER_PROJECT_REPO $COMPOSER_PROJECT .

composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config --no-interaction allow-plugins.laminas/laminas-dependency-plugin true
Expand Down
2 changes: 1 addition & 1 deletion php/7.3/fpm-alpine-dolphin/bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if [ -f 'pub/index.php' ]; then
echo "Setup took: $((SETUP_END-SETUP_START)) seconds..."
exit 0;
elif [ "$COMPOSER_PROJECT_ENABLED" == true ]; then
composer create-project --no-install --repository-url=https://repo.magento.com/ $COMPOSER_PROJECT .
composer create-project --no-install --repository-url=$COMPOSER_PROJECT_REPO $COMPOSER_PROJECT .

composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config --no-interaction allow-plugins.laminas/laminas-dependency-plugin true
Expand Down
2 changes: 1 addition & 1 deletion php/7.4/fpm-alpine-dolphin/bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -f 'pub/index.php' ]; then
echo "Setup took: $((SETUP_END-SETUP_START)) seconds..."
exit 0;
elif [ "$COMPOSER_PROJECT_ENABLED" == true ]; then
composer create-project --no-interaction --no-install --repository-url=https://repo.magento.com/ $COMPOSER_PROJECT .
composer create-project --no-interaction --no-install --repository-url=$COMPOSER_PROJECT_REPO $COMPOSER_PROJECT .

composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config --no-interaction allow-plugins.laminas/laminas-dependency-plugin true
Expand Down