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.

  • Running Docker Build from Jenkis, replace hardcoded Inputs in Dockerfile with parameters
  • Why use docker? Aren't java files like WAR files already running on JVM?
  • Docker: Unable to view running container despite successful demo example
  • Does docker build run commands twice?
  • Kubernetes pods are running but docker ps does not give any output
  • Bitbucket Pipeline Rake Test take 20 minutes
  • 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?

  • Running services (upstart/init.d) in a container
  • Auto-reloading of code changes with Django development in Docker with Gunicorn
  • Multiple projects (and fig.yml) linking to same database
  • Change Java “SecureRandom” in Dockerfile
  • where are $POSTGRES_PORT_5432_TCP_ADDR and $POSTGRES_PORT_5432_TCP_PORT come from?
  • Docker : How to configure Internet -> firewall container -> webserver container
  • 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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.