rogebrd
rogebrd

Reputation: 23

Elastic Beanstalk - Docker/Flask App - 502 Gateway Error

I am creating a simple Docker/Flask app that I wanted to deploy to elastic beanstalk but am unable to get it working.

The code for the backend app (including docker config) can be found here: https://github.com/rogebrd/sage/tree/move_to_docker/backend

For code deployment, I am pushing my code to s3 via a zip; script to do that can be found here: https://github.com/rogebrd/sage/blob/move_to_docker/scripts/bundle_to_zip.sh

The Elastic Beanstalk instance is pretty much in it's default configuration (only thing I changed was enabling logs)

The error I am getting when I hit the resource is - 502 - Gateway Error

Looking in var/log/eb-docker/containers/eb-current-app/stdouterr.log I am able to see the app is successfully spun up listening on port http://192.168.0.2:5000/

At this point, I don't really know where the issue could be originating from. My suspicion is that the ports aren't properly being mapped to which I have tried the .ebextensions that are in place now, using a Dockerrun.aws.json file instead of docker-compose, removing docker-compose entirely, and changing the server port to 8080 and 80 with no success.

Looking for any resources to point me in the right direction!

Upvotes: 1

Views: 824

Answers (1)

Marcin
Marcin

Reputation: 239005

You are using wrong ports in docker compose. Please change to:

    ports: [ '80:5000' ]

Upvotes: 6

Related Questions