Skip to content

MuhammadMullah/phoenix-docker-compose

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elixir / Phoenix containerized development environment

What you get

  • One-line dev environment setup: docker-compose up. It creates the database, does the Dialyzer pre-work (if the project has Dialyxer installed), and everything else.
  • Development-oriented config: Source code is mounted so that changes in the container appear on the host, and vice-versa.
  • Fast re-builds because the DOCKERFILE is written to help Docker cache the images.
  • Syncing with Postgres startup delay.
  • All the crappy little dependencies installed.
  • No weird hacks.

Uses Elixir 1.6.1, Phoenix 1.3.0, and latest Postgres. These are the latest versions as of 2018-02-02. Tested on MacOS and Fedora Linux, because that's what I happen to use. This is my configuration I develop with.

Instructions

  1. Copy the three config files to an existing Phoenix project which you want to Dockerize. Make run.sh executable, e.g. chmod +x run.sh.
  2. Edit your development database settings to connect to Postgres at host db, username postgres, password empty string.
  3. Spin it up with docker-compose up.

Tests can be run in the container like so:

docker-compose run web mix test

Or, for a slightly faster startup time,

docker-compose exec web mix test

... I haven't found a disadvantage of re-using the running container this way.

About

Docker development environment for Elixir+Phoenix

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 67.7%
  • Dockerfile 32.3%