dockerize_elixir
This project installs docker files into a new elixir project that sets up a
development environment. The development environment includes a database and
automatically runs your tests. Included are helper scripts to let you run iex
and various database tasks inside the containers.
This should work with plain elixir apps that use ecto, and phoenix apps.
Example
mix archive.install hex dockerize_elixir
mix dockerize my_app
docker compose up --buildAssumptions
- Assumes you're using ecto & PostgreSQL
- Assumes you add (mix_test_watch)[https://github.com/lpil/mix-test.watch] to your project for running tests when files change
To-do:
- Generate a prod ready Dockerfile, and script to build a releasable docker container.
- Support other databases. I don't really use anything except PostgreSQL, so I'd love PR's for this.
- Support apps that don't use ecto or database.
Gotchas
- If you run this in a phoenix app that uses their asset building stuff, the assets won't build due to (#5890)[https://github.com/phoenixframework/phoenix/issues/5890]. You'll have to make the changes in (#5891)[https://github.com/phoenixframework/phoenix/pull/5891] to your generated config files.