There are many ways to Deploy an Elixir application. This docker image is specifically built for the following setup:
- Docker applications are built using distillery which builds releases.
- They are deployed on Amazon ECS using docker containers. (You should be able to get it working on other container platforms too)
- Releases are built using bitwalker/alpine-elixir and pushed to an S3 bucket.
- Your applications are started using the
bootstrap.sh
script which downloads the release, unzips it and runs it
APP_NAME
: The name of your application which is defined in distillery.S3_BUCKET
: The S3 bucket where your releases are stored.RELEASE_TAR_PATH
: The full path of your release tar e.g.emailer/emailer-prod-0.1.6+ref-gbdfa6a9.tar.gz
.SSM_SECRET_NAME
: The path of your parameter store key where you can put your secret environment variables.
- Build a distillery release inside a
bitwalker/alpine-elixir
image e.g.rel/builds/emailer-prod-0.1.6+ref-gbdfa6a9.tar.gz
- Copy it to S3:
aws s3 cp "rel/builds/emailer-prod-0.1.6+ref-gbdfa6a9.tar.gz" "s3://deployments/emailer/"
- Register a task definition with the updated
RELEASE_TAR_PATH
. TODO - Update your service to use this new task definition.