Development environment for Elixir and Phoenix in Docker.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
LICENSE
README.md

README.md

docker_phx_dev

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

  1. Setup a docker-compose.yml file 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
  1. Create a new file named run.
  2. Run echo "docker-compose run --rm phx \"\$@\"" > run && chmox +x run
  3. Use the run command to work in the container.
  4. Create your pheonix project. Ex: ./run mix phx.new . --app hello
  5. Files will appear in vol/app
  6. Edit vol/app/config files to fix the DB hostname, which is "db" in the above example.
  7. Run ./run mix ecto.create
  8. docker-compose up and open http://localhost:4000

Production and Deployment Resources

Coming soon

Included Software Versions

  • elixir --version

Elixir 1.7.2 (compiled with Erlang/OTP 21)

  • erl --version

Erlang/OTP 21 [erts-10.0.5]

  • npm -v

5.6.0

  • nodejs --version

v8.11.4

  • yarn -v

1.9.4

Last build

August 18, 2018

Contributing

I am currently building and testing this. It has not been extensively used or tested. Issues and pull requests are welcome on GitHub.