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.

  • Docker volumes mount binding permissions difference between maven build and docker cli
  • Running OpenSSH in an Alpine Docker Container
  • Docker and sensitive information used at run-time
  • Dockerfile VOLUME definition to mount project tree
  • docker cannot connect to redis from file
  • [pacemaker]Docker compose autostart
  • 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?

  • How Wordpress should be runned on Docker
  • How to expose docker container's ip and port to outside docker host without port mapping on TinyCore?
  • Error: Cannot Start Container: stat /bin/sh: no such file or directory"
  • Running Docker container on a specific port
  • How can I identify why my replica's are not starting in the swarm?
  • How to get memory usage of processes running in docker 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.