services:

  test-integration:
    build:
      context: .
      target: test-integration
    environment:
      - DB_URL
      - QA_GRASS_HOST
      - QA_DB_HOST
      - QA_DB_USER
      - BASE_QA_WORKSTATION_URL
      - QA_DB_DATABASE
      - BASE_QA_OWS_CONTRACTS_URL
      - QA_DB_PASS
    env_file:
      - path: tests/integration/.env
        required: false
    volumes:
      - .:/var/app

  unit-lint:
    build:
      context: .
      target: unit-lint
    volumes:
      - .:/var/app

  ows-contracts-dev:
    build:
      context: .
      target: dev
    environment:
      - DB_URL
    env_file:
      - path: .env
        required: false
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/hello/"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s
    volumes:
      - .:/var/app

  ows-contracts-deploy:
    build:
      context: .
      target: deploy
    environment:
      - DB_URL
    env_file:
      - path: .env
        required: false
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/hello/"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s
