version: "3.7"

services:
  tests:
    build: .
    environment:
      - TEST_DATABASE_URL=postgres://admin:password@database:5432/cbwebreader_test
      - DJANGO_SETTINGS_MODULE=cbreader.settings.base
    links:
      - database
    command: >
      pytest
              -vvv
              --isort
              --flake8
              --black
              --cov=.
              --cov-report=term-missing
              --junitxml=/tmp/test-results.xml
    volumes:
      - ./cbreader:/src/cbreader
      - ./comic:/src/comic
      - ./comic_auth:/src/comic_auth
      - ${COMIC_BOOK_VOLUME}:/data
