Skip to content

Commit 8fda7d6

Browse files
author
ironex
committed
Allow to create new project in container
1 parent 46b36ea commit 8fda7d6

File tree

9 files changed

+20
-28
lines changed

9 files changed

+20
-28
lines changed

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,8 @@ __2) Start Docker__
3030
__3) Create new or add existing Magento project__
3131

3232
- Create new project
33-
- Store composer credentials to repo.magento.com in project repository
34-
- ``` sh bin/auth <public key> <private key>```
35-
- Creates auth.json
33+
- ```sh bin/new-project.sh```
3634
- Keys can be found in https://marketplace.magento.com/customer/accessKeys/
37-
- This will generate new gitignored auth.json file with credentials to repo.magento.com
38-
- For auth.json file to work, the composer.json (already added) is needed in project root
39-
40-
- Generate project files
41-
- ```sh bin/new-project.sh```
42-
- This step requires you to have php 7 and composer installed on your host machine
4335

4436
- Add existing project
4537
- Paste your existing Magento project to magento folder

auth.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "http-basic": { "repo.magento.com": { "username": "ec69d64512a555cb68354c9cfbe93b95", "password": "8eb444860ec984281ddb6b46ec6e9983" } } }

bin/auth.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

bin/composer.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
export USER_ID=$(id -u)
4+
export GROUP_ID=$(id -u)
5+
6+
docker-compose run --rm --workdir /magento php-fpm composer $@

bin/install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/sh
2+
13
docker-compose exec -T php-fpm /magento/bin/magento setup:install \
24
--base-url=http://magento.local \
35
--db-host=mysql \

bin/new-project.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
#!/bin/sh
2+
13
rm magento/.placeholder
2-
composer create-project --ignore-platform-reqs --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.2-p1 magento
4+
5+
sh bin/composer.sh create-project --ignore-platform-reqs --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.2-p1 .

bin/stop.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
#!/bin/sh
2+
13
docker-compose down

composer.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

docker/php-fpm/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ RUN docker-php-ext-install xsl
2828
RUN docker-php-ext-install zip
2929
RUN docker-php-ext-install sockets
3030

31-
# xdebug
31+
# Xdebug
3232
RUN apk add --no-cache $PHPIZE_DEPS \
3333
&& pecl install xdebug-3.0.4 \
3434
&& docker-php-ext-enable xdebug
3535

3636
COPY ./docker/php-fpm/php.ini /usr/local/etc/php/php.ini
3737

38+
# Composer
39+
RUN apk add composer
40+
3841
ARG GROUP_ID
3942
ARG USER_ID
4043

0 commit comments

Comments
 (0)