version: "3.4"

services:
  app:
    build:
      context: .
      target: test
    env_file:
      - .env.sample
    environment:
      CELERY_TASK_ALWAYS_EAGER: 1
    tty: true
    volumes:
      - .:/atlas-um
      - .:/tests
    depends_on:
      - pgdb
      - redis
      - musm
      - pg_m

  pgdb:
    image: postgres:11.7
    environment:
      POSTGRES_PASSWORD: bad_db_passwd
      POSTGRES_USER: atlas_um
      POSTGRES_DB: atlas_um
    command: ["postgres", "-c", "log_statement=all", "-c", "fsync=off", "-c", "full_page_writes=off"]

  pg_m:
    build:
      context: .
      dockerfile: ./migrations/Dockerfile
    env_file:
      - .env.sample
    command: ["--", "--verify"]
    depends_on:
      - pgdb

  redis:
    image: redis:alpine

  musm:
    image: mockserver/mockserver:mockserver-5.10.0
    command: -logLevel WARN -serverPort 1081
