version: '2.1'

services:

  tests:
    extends:
      file: docker-compose.yml
      service: base-app
    command: npm run watch-test
    volumes:
      - profiles-tests-node_modules:/code/node_modules
    environment:
      NODE_ENV: test
    links:
    - profiles-db:mongo

  travis-tests:
    extends:
      file: docker-compose.yml
      service: base-app
    command:
      sh -c "npm run git-hook && npm run upload-coverage-coveralls"
    volumes:
      - profiles-travis-tests-node_modules:/code/node_modules
    environment:
      COVERALLS_REPO_TOKEN: ${COVERALLS_REPO_TOKEN}
      NODE_ENV: development
      SNYK_TOKEN: ${SNYK_TOKEN}
      TRAVIS: ${TRAVIS}
      TRAVIS_BRANCH: ${TRAVIS_BRANCH}
      TRAVIS_COMMIT: ${TRAVIS_COMMIT}
      TRAVIS_JOB_ID: ${TRAVIS_JOB_ID}
    links:
    - profiles-db:mongo

  profiles-db:
    image: "nhsuk/profiles-db:${profiles_db_docker_image_tag-latest}"

volumes:
  profiles-tests-node_modules:
  profiles-travis-tests-node_modules:


version: '2.1'

services:

  tests:
    extends:
      file: docker-compose.yml
      service: base-app
    command: npm run watch-test
    volumes:
      - profiles-tests-node_modules:/code/node_modules
    environment:
      NODE_ENV: test
    links:
    - profiles-db:mongo

  travis-tests:
    extends:
      file: docker-compose.yml
      service: base-app
    command:
      sh -c "npm run git-hook && npm run upload-coverage-coveralls"
    volumes:
      - profiles-travis-tests-node_modules:/code/node_modules
    environment:
      COVERALLS_REPO_TOKEN: ${COVERALLS_REPO_TOKEN}
      NODE_ENV: development
      SNYK_TOKEN: ${SNYK_TOKEN}
      TRAVIS: ${TRAVIS}
      TRAVIS_BRANCH: ${TRAVIS_BRANCH}
      TRAVIS_COMMIT: ${TRAVIS_COMMIT}
      TRAVIS_JOB_ID: ${TRAVIS_JOB_ID}
    links:
    - profiles-db:mongo

  profiles-db:
    image: "nhsuk/profiles-db:${profiles_db_docker_image_tag-0.1.0}"

volumes:
  profiles-tests-node_modules:
  profiles-travis-tests-node_modules:


Use specific version of profile-db for testing
:scroll: Use specific version of profile-db for testing
