﻿version: '3'

services:
  server:
    profiles: ["test", "production"]
    build: .
    image: subterfuge_server
    depends_on:
      - db
    volumes:
      - ".:/var/www"
    ports:
      - 5295:5295
    environment:
      - ASPNETCORE_URLS=http://*:5295
      - DOTNET_ENVIRONMENT=Docker
      - ASPNETCORE_ENVIRONMENT=Docker
  db:
    image: "mongo:5.0-rc"
    command: --auth
    volumes:
      - "./mongodb:/data/db"
    ports:
      - 27017:27017
    environment:
      - MONGO_INITDB_ROOT_USERNAME=user
      - MONGO_INITDB_ROOT_PASSWORD=password
      - MONGO_INITDB_DATABASE=subterfugeDb
  server_test:
    profiles: ["test"]
    build:
      context: .
      target: test
    depends_on:
      - db
      - server
    environment:
      - ASPNETCORE_ENVIRONMENT=Docker

volumes:
  db: {  }