version: '3'

volumes:
  persistent-data:

services:
  rove-server:
    build:
      context: .
      dockerfile: Dockerfile
    image: rove:latest
    ports:
      - "9090:9090"
    environment:
      - PORT=9090
      - DATA_PATH=/mnt/rove-server
      - WORDS_FILE=data/words_alpha.txt
      - TICK_RATE=3
    volumes:
      - persistent-data:/mnt/rove-server:rw
    command: [ "./rove-server"]

  rove-tests:
    depends_on: [ rove-server ]
    build:
      context: .
      dockerfile: Dockerfile
    image: rove:latest
    environment:
      - ROVE_GRPC=rove-server
    command: [ "./script/wait-for-it.sh", "rove-server:9090", "--", "go", "test", "-v", "./...", "--tags=integration", "-cover", "-coverprofile=/mnt/coverage-data/c.out", "-count", "1" ]
    volumes:
      - /tmp/coverage-data:/mnt/coverage-data:rw


  
