This repository controls the creation of a docker hub image scottswezey/phx_dev:latest used for Elixir and Phoenix development within docker. While quite large in size, it should have everything you need to create a new phoenix project and develop the project within a docker volume. It also includes nodejs, npm, and yarn for working with assets through brunch or webpack. This image is not suitable for production or deployment use.
How to use
- Setup a
docker-compose.ymlfile with this template.
version: '3.7' services: phx: image: "scottswezey/phx_dev:1.7.2" ports: - "4000:4000" volumes: - ./vol/app:/app stdin_open: true tty: true depends_on: - db command: mix phx.server db: image: postgres:10 restart: always volumes: - ./vol/postgres:/var/lib/postgresql/data
- Create a new file named
echo "docker-compose run --rm phx \"\$@\"" > run && chmox +x run
- Use the run command to work in the container.
- Create your pheonix project. Ex:
./run mix phx.new . --app hello
- Files will appear in
vol/app/configfiles to fix the DB hostname, which is "db" in the above example.
./run mix ecto.create
docker-compose upand open http://localhost:4000
Production and Deployment Resources
Included Software Versions
Elixir 1.7.2 (compiled with Erlang/OTP 21)
Erlang/OTP 21 [erts-10.0.5]
August 18, 2018
I am currently building and testing this. It has not been extensively used or tested. Issues and pull requests are welcome on GitHub.