Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/carlo-colombo/elixir-buildpacks


https://github.com/carlo-colombo/elixir-buildpacks

cnb docker elixir erlang pack

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# elixir-buildpacks

A collection of buildpacks to build images of elixir projects

1. `erlang-runtime`
1. `elixir-runtime`
1. `mix-release` download project dependencies and create an [Elixir Release](https://elixir-lang.org/blog/2019/06/24/elixir-v1-9-0-released/#releases)
1. `elixir` meta buildpack that define the order in which buildpack run

In addition `rg.nl-ams.scw.cloud/carlo-colombo/elixir-builder` is a builder based on `ubuntu:bionic` including the 4 buildpacks.

This stack support `org.cloudfoundry.stacks.cflinuxfs3` (`cloudfoundry/cnb:cflinuxfs3`) and `io.github.carlo-colombo.elixir-builder`

### Umbrella applications

To create a release from an umbrella application run from the root of the application defining the release to build with the `RELEASE` env variable

```bash
pack build dashboard \
--path . \
--builder rg.nl-ams.scw.cloud/carlo-colombo/elixir-builder \
-e RELEASE=dashboard -e SECRET_KEY_BASE=asdadasdasd
```

Note: is not supported to build individual release from the app folder, as in app dependency and configuration would be outside of the directory passed to `pack`.

### Know limitations

- It at least partially support `phoenix`, it requires to pass in `SECRET_KEY_BASE` as environment variable. For example

```bash
pack build dashboard \
--path . \
--builder rg.nl-ams.scw.cloud/carlo-colombo/elixir-builder \
-e DEBUG=1 \
-e SECRET_KEY_BASE="$(mix phx.gen.secret)"
```

## How to build an image with pack

### Using the builder image

```bash
pack build \
--path \
--builder rg.nl-ams.scw.cloud/carlo-colombo/elixir-builder
```

### Using individual buildpacks

```bash
pack build \
--path \
--buildpack ./elixir/ \
-b ./elixir-runtime/ \
-b ./erlang-runtime/ \
-b ./mix-release/ \
--builder rg.nl-ams.scw.cloud/carlo-colombo/elixir-builder
```

## How to create the builder image

```bash
cd elixir-builder
./build.sh
```

It create an image on the local docker named `rg.nl-ams.scw.cloud/carlo-colombo/elixir-builder`