version: "2"

services:
  allocation_db:
    logging:
      driver: none
    image: "postgres:9.3.24"
    environment:
      POSTGRES_PASSWORD: "secret"
      POSTGRES_USER: "allocation"
    ports:
      - "5432:5432"
  allocation_service:
    depends_on:
      - allocation_db
    ports:
    - "80:80"
    build:
      context: ./
    environment:
      ALLOCATION__POSTGRES__PASSWORD: "secret"
      ALLOCATION__POSTGRES__USERNAME: "allocation"
      ALLOCATION__POSTGRES__DATABASE_NAME: "allocation"
      ALLOCATION__POSTGRES__HOST: "allocation_db"
    command: migrate-and-run
    restart: on-failure
  integration_tests:
    depends_on:
      - allocation_service
    build:
      context: ./integration_tests/
    environment:
      ALLOCATION_SERVICE_ENDPOINT: "http://allocation_service:80"
