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 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
12 changes: 9 additions & 3 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 Expand Up @@ -80,8 +86,8 @@ MAGENTO_CURRENCY=USD
MAGENTO_TIMEZONE="America/Chicago"

##########################################################################
# Whether or not to use sample data. By default, we use Venia.
# Whether or not to use sample data. By default, we use Luma.
# Supported values include 'venia', 'luma', 'none'
# Default: 'venia'
# Default: 'luma'
###########
MAGENTO_SAMPLE_DATA="venia"
MAGENTO_SAMPLE_DATA="luma"
2 changes: 1 addition & 1 deletion .github/workflows/test-env-startup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.COMPOSER_PROJECT }}
key: ${{ runner.os }}-composer-${{ matrix.COMPOSER_PROJECT }}-v1.0
restore-keys: |
${{ runner.os }}-composer-
- name: Add HTTP basic auth credentials for composer
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.
33 changes: 10 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,16 @@ 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 `COMPOSER_PROJECT_REPO` variable in `.env` file to `https://repo.magento.com/`


### Using Venia Data Sample
For now, if you want to use Venia data sample you'll need to configure your `auth.json` because it is only available repo.magento.com. Please follow [these steps](./composer/auth.md) to set up composer's `auth.json`

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

Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -79,7 +79,7 @@ bin/magento config:set web/seo/use_rewrites 1

if [ "$MAGENTO_SAMPLE_DATA" == "venia" ]; then
echo "Installing 'Venia' Sample Data...";
composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com
composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com/
composer require --no-interaction --ansi magento/venia-sample-data:*

bin/magento setup:upgrade
Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -79,7 +79,7 @@ bin/magento config:set web/seo/use_rewrites 1

if [ "$MAGENTO_SAMPLE_DATA" == "venia" ]; then
echo "Installing 'Venia' Sample Data...";
composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com
composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com/
composer require --no-interaction --ansi magento/venia-sample-data:*

bin/magento setup:upgrade
Expand Down
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -83,7 +83,7 @@ bin/magento config:set web/seo/use_rewrites 1

if [ "$MAGENTO_SAMPLE_DATA" == "venia" ]; then
echo "Installing 'Venia' Sample Data...";
composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com
composer config --no-interaction --ansi repositories.venia-sample-data composer https://repo.magento.com/
composer require --no-interaction --ansi magento/venia-sample-data:*

bin/magento setup:upgrade
Expand Down