-1

我正在为来自 docker-compose 的 magento 应用程序运行 PHP 部署程序。apache 在容器内,php 有内存限制。如果需要,我可以控制 Dockerfile。

目前我的问题是当我运行dep deploy它时崩溃:

$ dep deploy 
✈︎ Deploying master on main
✔ Executing task deploy:prepare
✔ Executing task deploy:lock
✔ Executing task deploy:release
✔ Executing task deploy:update_code
✔ Executing task deploy:shared
➤ Executing task deploy:vendors
✔ Executing task deploy:failed
✔ Executing task deploy:unlock

In Client.php line 103:
                                                                                                                                                                                                                         
  The command "cd /home/public_html/releases/20201214130007 && /usr/local/bin/composer install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-suggest" failed.  
                                                                                                                                                                                                                         
  Exit Code: 255 (Unknown error)                                                                                                                                                                                         
                                                                                                                                                                                                                         

如果我在容器内运行 composer 行并添加无限的内存,它可以工作:

php -d memory_limit=-1 /usr/local/bin/composer install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-suggest

我试图强制部署者以这种方式使用作曲家,但没有奏效:

# in deployer.php:
set('composer', 'php -d memory_limit=-1  /usr/local/bin/composer');

我认为这是因为从详细日志中可以看出,它composer在执行操作时没有使用集合中的 :deployer:vendors

➤ Executing task deploy:vendors
[main] > if hash unzip 2>/dev/null; then echo 'true'; fi
[main] < true
[main] > if hash composer 2>/dev/null; then echo 'true'; fi
[main] < true
[main] > command -v 'composer' || which 'composer' || type -p 'composer'
[main] < /usr/local/bin/composer
[main] > cd /home/public_html/releases/20201214125356 && /usr/local/bin/composer install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-suggest

任何建议如何解决这个问题?

4

1 回答 1

1

要更改部署程序使用的作曲家二进制文件,您需要设置bin/composer,因此更改此

set('composer', 'php -d memory_limit=-1  /usr/local/bin/composer');

对此

set('bin/composer', 'php -d memory_limit=-1  /usr/local/bin/composer');
于 2020-12-14T11:43:15.487 回答