The plan; use Distillery to build the Elixir apps in a Docker container. Then create Docker containers with the compiled apps. Use those to deploy on AWS Beanstalk. Build the AWS Beanstalk setup with Terraform. And deploy through a Makefile to automate things.
It’s a lot of setup to deploy an app!
There’s a lot here so I’ve split it out into multiple posts.
The project is an Elixir Umbrella application. There is a Web app and an Admin app. They are backed by a business logic app, called Company here, that manages the database interactions.
Use Distillery to create two releases, one for the Web and one for the Admin.
Use Terraform to create the database on RDS and the Beanstalk applications for each of the releases.
Make to build the docker images, push to AWS, and update the Beanstalk applications.
There are still some things to take care of.
- Manage the DNS with Terraform
- Manage SSH with Terraform to get to the instances.
- Setup Continuous Integration & Deployments.
I’ve tried to keep track of all the places that helped get this working. I probably forgot some, including some StackOverflow posts. Sorry!