Elixir
Prerequisites
⚠️
Building on Mac ARM (M1+) processors isn’t supported due to a bug cause Erlang to be incompatible with Rosetta emulation.
Use a Linux host or Github Action instead.
- Set memory to at least 1MB during app creation or later using:
$ tapit create app myAppName memory=1
# or
$ tapit set process name=default memory=1
- Ensure you use the Elixir buildpack by editing your
tapit.tomlfile in the app dir: ```tomltapit.toml
app = “myAppName”
buildpacks = [ “https://tapitalee.s3.us-west-2.amazonaws.com/buildpacks/elixir/elixir-0.5.tgz” ]
[environment_variables] ELIXIR_VERSION = “1.17.2”
#### Optional configuration
* Specify a web process with a `Procfile`
#### Add a database
Options for AWS-managed database add-ons include RDS MySQL and Postgres.
By default the connection and authnetication details are sent to the app via the environment variable `DATABASE_URL`, which Elixir handles automatically by default.
#### Set environment variables
$ tapit set variable SECRET_KEY_BASE mix phx.gen.secret secret=yes
#### Migrate database
To run commands interactively at a shell prompt:
```bash
$ tapit run bash
To create a background task (without console interactions, ideal for scripting) for DB migration:
$ tapit create task 'mix ecto.migrate'