version: '3.0' # specify docker-compose version

# Define the services/ containers to be run
services:
  api-test: # name of the second service
    build: 
      context: ../ # specify the directory of the Dockerfile
      dockerfile: docker/Dockerfile-tests
    depends_on:
      - postgresdb
    container_name: api-test
    links:
      - postgresdb

    ports:
      - "4000:4000" #specify ports mapping
    env_file:
     - .env.test

  postgresdb: # name of the third service
    image: postgres:10.4 # specify image to build container from
    container_name: postgresdb
    ports:
      - "5432:5432" # specify port forwarding
    env_file:
     - .postgres
    logging:
      driver: none
