@@ -1,4 +1,4 @@
-SHELL := /bin/bash
+SHELL := /usr/bin/env bash
args = `arg="$(filter-out $(firstword $(MAKECMDGOALS)),$(MAKECMDGOALS))" && echo $${arg:-${1}}`
@@ -64,7 +64,7 @@ help:
@echo "$(call format,xdebug,'Disable or enable Xdebug.')"
bash:
- @./bin/bash
+ @./usr/bin/env bash
cache-clean:
@./bin/cache-clean $(call args)
@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env bash
bin/cli vendor/bin/phpstan analyse "$@"
bin/cli bash
COMPOSER_GLOBAL=/var/www/.composer-global
CACHE_CLEAN=${COMPOSER_GLOBAL}/vendor/bin/cache-clean.js
@@ -1,3 +1,3 @@
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
bin/docker-compose exec phpfpm "$@"
# -T: Disable pseudo-tty allocation
bin/docker-compose exec -T phpfpm "$@"
# Without stdout and stderr
bin/clinotty "$@" >/dev/null 2>&1
bin/cli composer "$@"
[ -z "$1" ] && echo "Please specify a directory or file to copy from container (ex. vendor, --all)" && exit
REAL_SRC=$(cd -P "src" && pwd)
[ -z "$1" ] && echo "Please specify a directory or file to copy to container (ex. vendor, --all)" && exit
[ -z "$1" ] && echo "Please specify a service operation (start|stop|status|restart|reload|force-reload)" && exit
bin/root service cron "$@"
bin/root touch /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status
[ -z "$1" ] && echo "Please specify test type (ex. integration)" && exit
bin/magento dev:urn-catalog:generate misc.xml
bin/copyfromcontainer misc.xml
mkdir -p src/.idea
bin/n98-magerun2 dev:console
if docker compose version > /dev/null 2>&1; then
DOCKER_COMPOSE="docker compose"
VERSION=${1:-2.4.5-p1}
EDITION=${2:-community}
echo "Fixing filesystem ownerships..."
if [ -z "$1" ]; then
echo "Fixing filesystem permissions..."
bin/cli npx grunt "$@"
if ! bin/cliq ls /usr/local/bin/install-php-extensions; then
echo "Downloading install-php-extensions, just a moment..."
bin/rootnotty curl -sSLf \
bin/cli bin/magento "$@"
bin/clinotty vendor/bin/mftf "$@"
# shellcheck source=../env/db.env
source env/db.env
bin/n98-magerun2 db:dump --stdout "$@"
if ! bin/cliq ls bin/n98-magerun2.phar; then
echo "Downloading n98-magerun2.phar, just a moment..."
bin/clinotty curl -sS -O https://files.magerun.net/n98-magerun2.phar
bin/cli node "$@"
bin/cli npm "$@"
bin/clinotty vendor/bin/phpcbf --standard=Magento2 --extensions=php,phtml --error-severity=10 --ignore-annotations "$@"
bin/clinotty vendor/bin/phpcs --standard=Magento2 --extensions=php,phtml --error-severity=10 --ignore-annotations "$@"
bin/clinotty vendor/bin/phpcs --standard=Magento2 --extensions=php,phtml --error-severity=10 --ignore-annotations --report=json "$@" > report.json
set -o errexit
if [ ! -d pwa-studio ]; then
bin/docker-compose exec redis "$@"
bin/docker-compose rm
bin/stopall
bin/remove
bin/removevolumes
current_folder=${PWD##*/}
volume_prefix=$(echo "$current_folder" | awk '{print tolower($0)}' | sed 's/\.//g')
docker volume rm "${volume_prefix}"_appdata
bin/stop "$@"
bin/start "$@"
bin/docker-compose exec -u root phpfpm "$@"
bin/docker-compose exec -u root -T phpfpm "$@"
MEM_BYTES=$(docker info -f '{{.MemTotal}}')
MAGENTO_USERNAME_PROP="http-basic.repo.magento.com.username"
MAGENTO_PASSWORD_PROP="http-basic.repo.magento.com.password"
hash composer 2>/dev/null && IS_COMPOSER_ON_HOST=true
[ -z "$1" ] && echo "Please specify a domain name (ex. magento.test)" && exit
echo "Confirming n98-magerun2 is installed..."
bin/n98-magerun2 > /dev/null 2>&1
echo "Install NodeJS and Yarn on host machine, otherwise setup will fail"
[ -z "$1" ] && echo "Please specify a domain (ex. mydomain.test)" && exit
# Generate certificate authority if not already setup
# Generate a new local CA "/root/.local/share/mkcert"
bin/docker-compose exec -T -u root app mkcert -install
MEM=$(docker info | grep "Total Memory" | cut -d':' -f2 | xargs | sed s/GiB//)
bin/docker-compose ps
bin/docker-compose stop "$@"
if [ -z "$(docker ps -q)" ]; then
echo "You have no running container"
else
mkdir -p tmpupdate && cd "$_"
curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
S=$(bin/clinotty cat /usr/local/etc/php/php.ini | grep -iGc 'xdebug.mode = off');
DOMAIN=${1:-magento.test}
git init -qqq
git remote add origin https://github.com/markshust/docker-magento
git fetch origin -qqq