Dockerise your new or existing Elixir/Phoenix applications in one easy command.
Dockerise your Elixir project in one simple command.
You need to install this as an executable Escript. By downloading a binary you will be able to run
exdocker my_project (where
my_project is the name of the folder in which you would either like to create an Elixir app, or where one already eixsts.) for your Elixir project to be set up with some simple files to help Dockerise it.
- Make sure
~/.mix/escriptsis in your machine's
$PATH. You can do this by adding
export PATH=~/.mix/escripts:$PATHto your
.bashrcor similar file.
mix escript.install hex ex_docker
exdocker hello_docker- [info] Created new project: hello_docker
Create a new Elixir project
- mix phx.new my_project (create a new Phoenix project)
- exdocker my_project (add Docker & Make files)
Add to an existing Elixir project
- exdocker my_project
Three files get created in the root of your project:
You can then run
make init shell from the root to build and run Docker containers, then when this command finishes, you'll be inside a shell session with Elixir and Mix installed.