Skip to content

Commit

Permalink
Improve use of Composer with dev/openmage environment and filesystem …
Browse files Browse the repository at this point in the history
…permissions.
  • Loading branch information
colinmollenhour committed Apr 22, 2023
1 parent 0bf974c commit 54e9a77
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions dev/openmage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ on the containers used in this setup, but here are some quick tips:
Here are some common commands you may wish to try:

```
$ docker-compose run --rm -u $(id -u):$(id -g) cli composer require {some-module}
$ docker-compose run --rm cli magerun sys:check
$ docker-compose run --rm cli magerun cache:clean
$ docker-compose run --rm cli magerun db:console
Expand Down
8 changes: 2 additions & 6 deletions dev/openmage/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ services:
user: www-data
volumes:
- ../..:/var/www/html
# environment:
environment:
- COMPOSER_HOME=${COMPOSER_HOME:-/var/www/html/var/.composer}
# - AWS_ACCESS_KEY_ID=00000000000000000000
# - AWS_SECRET_ACCESS_KEY=0000000000000000000000000000000000000000
# - AWS_REGION=eu-west-1
Expand All @@ -43,11 +44,6 @@ services:
- mysql
- "apache:${HOST_NAME:-openmage-7f000001.nip.io}"

composer:
image: composer:2.4
volumes:
- ../..:/app

mysql:
image: mysql:5.7
ports:
Expand Down
7 changes: 4 additions & 3 deletions dev/openmage/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ if test -f ../../app/etc/local.xml; then
fi

echo "Preparing filesystem..."
chmod 777 ../../app/etc ../../media ../../media/* ../../var
chmod g+s ../../app/etc ../../media ../../media/* ../../var
mkdir -p ../../vendor
chgrp 33 ../../app/etc ../../media ../../media/* ../../var ../../vendor
chmod g+ws ../../app/etc ../../media ../../media/* ../../var ../../vendor
$dc run --rm --no-deps cli mkdir -p var/cache var/log var/locks var/session

echo "Starting services..."
Expand All @@ -48,7 +49,7 @@ for i in $(seq 1 20); do
done

echo "Installing Composer dependencies..."
$dc run --rm composer composer install --no-progress --ignore-platform-req=ext-*
$dc run --rm -u "$(id -u):$(id -g)" cli composer install --no-progress

echo "Installing OpenMage LTS..."
$dc run --rm cli php install.php \
Expand Down

0 comments on commit 54e9a77

Please sign in to comment.