diff --git a/apps/magento/.env b/apps/magento/.env index 4d713f252..5d025a80e 100644 --- a/apps/magento/.env +++ b/apps/magento/.env @@ -11,7 +11,7 @@ W9_LOGIN_USER=admin W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD # If no domain, should use Internet IP replace it. e.g 47.243.184.40, don't add :port for magneto url here -W9_URL=appname.example.com +W9_URL="" W9_URL_REPLACE=true W9_ADMIN_PATH=/admin diff --git a/apps/magento/docker-compose.yml b/apps/magento/docker-compose.yml index 47f1ca18b..02d7ab3df 100644 --- a/apps/magento/docker-compose.yml +++ b/apps/magento/docker-compose.yml @@ -33,7 +33,7 @@ services: /bin/sh -c " apt update -y apt install -y --no-install-recommends wget - while [ ! -f /data/vendor/magento/language-zh_hans_cn ]; do + while [ ! -d /data/vendor/magento/language-zh_hans_cn ]; do echo 'Waiting for bin/magento to be created...' sleep 10 done @@ -43,6 +43,10 @@ services: cd /data bin/magento setup:static-content:deploy zh_Hans_CN bin/magento indexer:reindex + if [ -z \"$W9_URL\" ]; then + echo 'W9_URL is empty, not need to change, exiting...' + exit 0 + fi if [[ $W9_URL =~ ^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ ]]; then wp_url=$W9_URL:$W9_HTTP_PORT_SET echo 'URL is IP'