version: '3.4'

services:
  db:
     container_name: workflowserver-mongo
     image: mongo:5.0.14
     environment:
       MONGO_INITDB_ROOT_USERNAME: root
       MONGO_INITDB_ROOT_PASSWORD: mongopassword
     volumes:
       - dbdata:/data/db
     restart: always
     ports:
       - "27017:27017"
  start_db:
    container_name: workflowserver-mongo-wait
    image: mongo:5.0.14
    depends_on:
       - db
    volumes:
       - ./:/home/.docker
    entrypoint: /home/.docker/wait-for-mongo.sh workflowserver-mongo root mongopassword
  workflowserver:
    container_name: workflowserver
    depends_on:
       - db
    build:
      context: ..
      dockerfile: ./WorkflowServer/Dockerfile
    ports:
       - "8077:8077"
       - "8078:8078"
    volumes:
       - ./../logs:/app/wfs/logs
       - ./../license:/app/wfs/license
       - ./../metadata:/app/wfs/metadata
       - ./../InitialScripts:/app/wfs/InitialScripts
    environment:
      ConnectionString: mongodb://root:mongopassword@workflowserver-mongo:27017/ws?authSource=admin
      Provider: mongodb
      LicensePath: /app/wfs/license/  
      MetadataFolder: /app/wfs/metadata/ 
      DefaultLoggerConfig__FileTarget__0: Information
      DefaultLoggerConfig__FileTarget__1: Error
      DefaultLoggerConfig__FileSettings__FileName: /app/wfs/logs/log.txt
      DefaultLoggerConfig__FileSettings__RollingInterval: Day
      DefaultLoggerConfig__FileSettings__RetainedFileCountLimit: 30
volumes:
    dbdata:
      name: wfs-mongo-data
