docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Some ideas to improve docker-magento

Open rangerz opened this issue 4 years ago • 4 comments

Please give me some advice and comment to agree and disagree them.

~~1. bin/start, before docker start to check delegated files and folder (#256)~~

~~2. bin/mysql, bin/dbdump, provide import and export db (#259)~~

  1. bin/patch, for apply patch m2-hotfixes (magento-cloud)
#!/bin/bash
PATCH_DIR=${1:-m2-hotfixes}

for file in $(bin/clinotty ls $PATCH_DIR); do
    if [ ${file: -6} == ".patch" ]; then
        echo "Apply $file"
        bin/clinotty git apply $PATCH_DIR/$file
    fi
done
  1. bin/redeploy, clean anything and redeploy magento
#!/bin/bash
if [ "$1" == "--all" ]; then
    bin/clinotty rm -rf vendor
    bin/composer install
    bin/patch
fi

bin/magento maintenance:enable --ip=none

# Use sh -c for asterisk character '*'
bin/clinotty sh -c "rm -rf var/cache/*"
bin/clinotty sh -c "rm -rf var/page_cache/*"
bin/clinotty sh -c "rm -rf generated/*"
bin/clinotty sh -c "rm -rf var/view_preprocessed/*"
bin/clinotty sh -c "rm -rf pub/static/frontend/*"
bin/clinotty sh -c "rm -rf pub/static/adminhtml/*"
bin/clinotty sh -c "rm -rf pub/static/_requirejs/*"
bin/clinotty sh -c "rm -rf var/di/*"
bin/clinotty sh -c "rm -rf var/composer_home"

bin/magento setup:upgrade
bin/magento setup:di:compile
# bin/magento setup:static-content:deploy -f
bin/magento cache:flush

bin/magento maintenance:disable --ip=none

~~5. bin/setup, use setup:install to setup redis settings, adminurl, and secure base url(#304 )~~

...
bin/clinotty bin/magento setup:install \
    --base-url=https://$BASE_URL/ \
    --base-url-secure=https://$BASE_URL/ \
    --backend-frontname=admin \
...
    --cache-backend=redis \
    --cache-backend-redis-server=redis \
    --cache-backend-redis-db=0 \
    --page-cache=redis \
    --page-cache-redis-server=redis \
    --page-cache-redis-db=1 \
    --session-save=redis \
    --session-save-redis-host=redis \
    --session-save-redis-log-level=4 \
    --session-save-redis-db=2
...
  1. Support Ngrok.io or other options for temporarily public accessing docker env.

rangerz avatar Jul 02 '20 06:07 rangerz

Thanks @rangerz! Suggestions like this make the project so much better.

I'll need some time to review/analyze. I'm trying to get a major version out today first, then will look over this list 👍

markshust avatar Jul 30 '20 10:07 markshust

Nginx doesn't allow to run store view in the subdirectory, does anyone know it??

hieulecoffeemug avatar Oct 07 '20 18:10 hieulecoffeemug

Was there any traction on supporting ngrok? I tried setting it up as I usually would by opening port 80: ./ngrok http --region=us --hostname=[url] 80

updated my Magento urls to my ngrok URL but I just get "[url] redirected you too many times ERR_TOO_MANY_REDIRECTS." in the browser and: GET / 301 Moved Permanently in the ngrok terminal.

I'll update if I figure anything else out.

tylerpage avatar Nov 15 '21 18:11 tylerpage

@tylerpage After starting ngrok, you will need to update Magento's config values that point to that domain. There is a helper at bin/setup-domain you can use to assist with this, and you will need to point it at the ngrok domain.

markshust avatar Nov 18 '21 21:11 markshust