version: "2"

services:
  postgres:
    image: postgres
    expose:
      - "5432"
    ports:
      - 54320:5432
    volumes:
      - postgres-data:/var/lib/postgresql

  elasticsearch:
    image: elasticsearch
    expose:
      - "9200"

  web: &api_base
    build: .
    command: bash -c "mix do deps.get, compile, ecto.create, ecto.migrate, phoenix.server"
    depends_on:
      - postgres
      - elasticsearch
    env_file: .env
    environment: &api_environment
      MIX_ENV: dev
      PORT: 4000
      DATABASE_POSTGRESQL_HOST: postgres
      DATABASE_POSTGRESQL_USERNAME: postgres
    links:
      - postgres
      - elasticsearch
    ports:
      - 49235:4000
    volumes:
      - code-corps-api:/code-corps-api

  test:
    <<: *api_base
    depends_on:
      - web
    environment:
      <<: *api_environment
      MIX_ENV: test
      PORT: 4001
    ports:
      - 49236:4001

  apiary:
    image: apiaryio/client
    command: preview --server --host=0.0.0.0 --port=8080 --path=/code-corps-api/blueprint/api.apib
    ports:
      - 8081:8080
    volumes:
      - code-corps-api:/code-corps-api

volumes:
  code-corps-api:
  postgres-data:

version: "2"

services:
  postgres:
    image: postgres
    expose:
      - "5432"
    ports:
      - 54320:5432
    volumes:
      - postgres-data:/var/lib/postgresql

  elasticsearch:
    image: elasticsearch
    expose:
      - "9200"

  web: &api_base
    build: .
    command: bash -c "mix do deps.get, compile, ecto.create, ecto.migrate, phoenix.server"
    depends_on:
      - postgres
      - elasticsearch
    env_file: .env
    environment: &api_environment
      MIX_ENV: dev
      PORT: 4000
      DATABASE_POSTGRESQL_HOST: postgres
      DATABASE_POSTGRESQL_USERNAME: postgres
    links:
      - postgres
      - elasticsearch
    ports:
      - 49235:4000
    volumes:
      - .:/code-corps-api

  test:
    <<: *api_base
    depends_on:
      - web
    environment:
      <<: *api_environment
      MIX_ENV: test
      PORT: 4001
    ports:
      - 49236:4001

  apiary:
    image: apiaryio/client
    command: preview --server --host=0.0.0.0 --port=8080 --path=/code-corps-api/blueprint/api.apib
    ports:
      - 8081:8080
    volumes:
      - .:/code-corps-api

volumes:
  postgres-data:

Remove source code volume from docker setup.
Remove source code volume from docker setup.

f6011cf291292967d49d22d3c5421755b9f484b3 changed the setup to use a docker volume for the code. This meant that code changes wouldn't be updated in the containers.

This commit basically reverts this changes.
