version: '3.1'
services:
  db:
    image: postgres:9.5.17-alpine
    restart: always
  app:
    build:
      context: .
      dockerfile: Dockerfile
    command: "mix phx.server"
    entrypoint: /opt/app/docker-entrypoint.sh
    volumes:
      - .:/opt/app
      - elixir:/opt/elixir
      - mix_deps:/opt/app/deps
    depends_on:
      - db
    links:
      - db:db
volumes:
  elixir:
  mix_deps:
