version: '3.6'

services:
  mongo:
    image: mongo
    restart: unless-stopped
    environment:
      MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-root}
      MONGO_INITDB_ROOT_PASSWORD: ${DB_PWD:-TurnenAufZeit}

  server:
    image: sim-server:${VERSION}
    ports:
      - "127.0.0.1:3000:${SERVER_PORT:-3000}"
    environment:
      SYSTEM_NAME: ${SYSTEM_NAME:-TurnenAufZeit}
      DB_USER: ${DB_USER:-root}
      DB_PWD: ${DB_PWD:-TurnenAufZeit}
      DB_HOST: ${DB_HOST:-mongo}
      DB_PORT: ${DB_PORT:-27017}
      DB_SOURCE: ${DB_SOURCE:-admin}
      DB_DB: ${DB_DB:-TurnenAufZeit}
      MAIL_HOST: ${MAIL_HOST:-}
      MAIL_PORT: ${MAIL_PORT:-25}
      MAIL_SECURE: ${MAIL_SECURE:-false}
      MAIL_USER: ${MAIL_USER:-}
      MAIL_PWD: ${MAIL_PWD:-}
      MAIL_ADDRESS: ${MAIL_ADDRESS:-}
      MAIL_NAME: ${MAIL_NAME:-}
      SERVER_PORT: ${SERVER_PORT:-3000}
      SERVER_LISTEN: ${SERVER_LISTEN:-0.0.0.0}
      SERVER_HOST: ${SERVER_HOST:-http://localhost:8080}
      ADMIN_MAIL: ${ADMIN_MAIL:-}
    depends_on:
      - mongo

  client:
    image: sim-client:${VERSION}
    ports:
      - 8080:80
    depends_on:
      - server