2
votes

I have tried to get this project deployed to AWS Elastic Beanstalk: https://github.com/coralproject/talk The dockerfile exposes port 5000 and I have defined environment variables also all using port 5000.

When I run the project locally with the recommended docker-compose file (https://coralproject.github.io/talk/installation-from-docker/#installing) everything works fine locally.

But when I deploy the app to Beanstalk, the html page is served and loads fine, however other files that are referenced locally such as my bundle.js and favicon files return a 502.

What am I missing?

Logs that may be relevant:

/var/log/eb-activity.log cat: /var/app/current/Dockerrun.aws.json: No such file or directory 8c17e6ddb0f842e592940a3aa67d0f39ec8702eb4ad6c3f9b876fc33b7f02ddc [2018-02-11T08:29:26.836Z] INFO [24507] - [Application update app-5d978-180211_092600@12/AppDeployStage1/AppDeployEnactHook/01flip.sh] : Starting activity... [2018-02-11T08:29:28.428Z] INFO [24507] - [Application update app-5d978-180211_092600@12/AppDeployStage1/AppDeployEnactHook/01flip.sh] : Completed activity. Result: nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf:11
Stopping nginx: [ OK ] Starting nginx: nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf:11
[ OK ] cat: /var/app/current/Dockerrun.aws.json: No such file or directory /opt/elasticbeanstalk/hooks/common.sh: line 95: [: 1: unary operator expected iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ]

The nginx access log only shows the html requests not the other files

/var/log/nginx/access.log 95.90.245.122 - - [11/Feb/2018:22:43:00 +0000] "GET / HTTP/1.1" 302 72 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" 95.90.245.122 - - [11/Feb/2018:22:43:00 +0000] "GET /admin/install HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" 95.90.245.122 - - [11/Feb/2018:22:45:57 +0000] "GET /admin/install HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" 95.90.245.122 - - [11/Feb/2018:22:46:04 +0000] "GET / HTTP/1.1" 302 72 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" 95.90.245.122 - - [11/Feb/2018:22:46:04 +0000] "GET /admin/install HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"

I see this when I access the page:

install:45 GET https://talk-now.us-east-1.elasticbeanstalk.com:5000/static/coral-admin/bundle.js net::ERR_CONNECTION_REFUSED :5000/public/img/favicon-32x32.png:1 GET https://talk-now.us-east-1.elasticbeanstalk.com:5000/public/img/favicon-32x32.png net::ERR_CONNECTION_REFUSED :5000/public/img/favicon-16x16.png:1 GET https://talk-now.us-east-1.elasticbeanstalk.com:5000/public/img/favicon-16x16.png net::ERR_CONNECTION_REFUSED :5000/public/img/favicon-96x96.png:1 GET https://talk-now.us-east-1.elasticbeanstalk.com:5000/public/img/favicon-96x96.png net::ERR_CONNECTION_REFUSED

1
Can you check the Beanstalk access log files to determine what's wrong. There must be an indication there.progfan
@progfan I have added the logs to the original postMustika

1 Answers

0
votes

The problem is that you are missing a Dockerrun.aws.json file at the root level of your repository. This file is necessary for Beanstalk to determine how to execute the set of containers in your project.

Also note that the format of the sections in this file is similar to that of Amazon ECS Task definitions