Run one app on multiple elastic beanstalk instances
I have one Flask app which handles a number of things which are common to a number of elastic beanstalk applications: logging, database/ORM, error handling, are all handled by Flask, and similar across elastic beanstalk instances.
I have four eb applications, which each do different jobs, demand different docker images, and so on.
One approach would be have each eb app target its own unique endpoint on the Flask App and follow its own unique code path, while sharing common resources, such as the ORM and error handling.
Is this possible? The big limitation seems to be one Dockerfile per project, which has a fixed name, and sets the image. I would rather be able to specify the Dockerfile-path at deploy-time.
Is this even a reasonable approach to take?
One Solution collect form web for “Run one app on multiple elastic beanstalk instances”
You’ve got three options:
Run multiple services in one container: Treat containers like VMs; run both your Flask app and your other services in one container. You could then have the Flask app built as a base container and build your other 4 applications off that base.
Run an internal service on another instance: Put the Flask app on a 5th EB machine, one that’s internal-facing, and direct the other 4 to talk to it.
Don’t use Elastic Beanstalk: Provision your own instance and run it the way you like.
Of these, I’d strongly consider the last. Once you find yourself trying to work around the limitations of EB, you’ve probably outgrown it.