Error writing dockerrun.aws.json v2 file

2019-08-26 07:09发布

I am using this file to deploy a multicontainer nginx php-fpm application in AWS.

I run eb local run and shows me this error.

holdbusinessnginx_1 | nginx: [emerg] host not found in upstream "php:9000" in /etc/nginx/conf.d/upstream.conf:1 elasticbeanstalk_holdbusinessnginx_1 exited with code 1

It probably is because nginx is running before php-fpm.

In docker-compose.yml file there is a directive called depends-on.

Is there a way to use it in dockerrun.aws.json file?

2条回答
混吃等死
2楼-- · 2019-08-26 07:44

Sorry to take so much for the response. It was really that. A misatention mine.

查看更多
迷人小祖宗
3楼-- · 2019-08-26 07:47

Just use directive of

  "links": [
    "php"
  ],

where php will be the name of other container you defined in the same Dockerrun.aws.json file. EB is kinda guessing the dependencies on the links, volumes etc. So with forcing nginx container to link to php you're saying to the EB that php should get up before nignx. In shortcut. :-)

查看更多
登录 后发表回答