version: "3.0"
services:
  mongo:
    image: mongo:3
    restart: always
    volumes:
      - /var/lib/mongo
    command: --smallfiles

  mariadb:
    image: mariadb:10
    restart: always
    volumes:
      - /var/lib/mariadb
    environment:
      MYSQL_DATABASE: nbi
      MYSQL_ROOT_PASSWORD: $SPRING_DATASOURCE_PASSWORD
# APP  ***************************************************************************************
  nbi:
    build:
      context: .
      args:
        SERVER_PORT: $SERVER_PORT
    ports:
    - $SERVER_PORT:$SERVER_PORT
    environment:
      SPRING_DATASOURCE_URL: jdbc:mariadb://mariadb:3306/nbi
      SPRING_DATA_MONGODB_HOST: mongo
    depends_on:
    - mariadb
    - mongo
volumes:
  mariadb:
  mongo: