Docker在启动脚本中运行composer,composer从不运行

Docker在启动脚本中运行composer,composer从不运行,docker,composer-php,supervisord,Docker,Composer Php,Supervisord,我有一个docker容器,它实际上是一个灯堆。我使用supervisord来管理流程 我可以在容器启动时执行bash脚本,但无法让脚本运行composer 我的简单脚本 #!/bin/bash git clone https://github.com/[..project..].git /var/www/ wait composer update -d /var/www/ wait # Just here to test if we make it this far... touch /v

我有一个docker容器,它实际上是一个灯堆。我使用supervisord来管理流程

我可以在容器启动时执行bash脚本,但无法让脚本运行composer

我的简单脚本

#!/bin/bash

git clone https://github.com/[..project..].git /var/www/
wait

composer update -d /var/www/
wait

# Just here to test if we make it this far...
touch /var/www/test

exit
以及supervisord.conf中负责运行它的部分

[program:deploy]
command=bash deploy.sh
directory=/usr/local/bin/
user=root
autostart=true
autorestart=false
environment=PATH="/usr/bin"
redirect_stderr=true
这将成功克隆存储库,并接触测试文件,但跳过正在运行的composer。如果我在容器中打开一个shell,我可以成功地手动执行脚本


关于如何解决这个问题,有什么建议吗?

我的supervisord配置有问题

正确的配置是

[program:deploy]
command=bash /usr/local/bin/deploy.sh
autostart=true
autorestart=false
redirect_stderr=true
stdout_logfile=/var/log/composer/run.log

似乎问题是当脚本从supervisord运行时找不到composer。。。。