version: '3'

services:
  mongo:
    restart: always
    image: mongo
    volumes:
      - mongo_data:/data/db
  qux-fe:
    restart: always
    image: klausenschaefersinho/quant-ux
    environment:
      - QUX_PROXY_URL=http://quant-ux-backend:8080
      - QUX_AUTH=${QUX_AUTH}
      - QUX_KEYCLOAK_REALM=${QUX_KEYCLOAK_REALM}
      - QUX_KEYCLOAK_CLIENT=${QUX_KEYCLOAK_CLIENT}
      - QUX_KEYCLOAK_URL=${QUX_KEYCLOAK_URL}
      - QUX_WS_URL=${QUX_WS_URL}
    links:
      - mongo
      - qux-be
    ports:
      - 8082
    depends_on:
      - qux-be

  qux-be:
    restart: always
    image: klausenschaefersinho/quant-ux-backend
    volumes:
      - quant_ux_data:/app-data
    environment:
      - QUX_HTTP_HOST=${QUX_HTTP_HOST}
      - QUX_HTTP_PORT=8080
      - QUX_MONGO_DB_NAME=${QUX_MONGO_DB_NAME}
      - QUX_MONGO_TABLE_PREFIX=${QUX_MONGO_TABLE_PREFIX}
      - QUX_MONGO_CONNECTION_STRING=mongodb://quant-ux-mongo:27017
      - QUX_MAIL_USER=${QUX_MAIL_USER}
      - QUX_MAIL_PASSWORD=${QUX_MAIL_PASSWORD}
      - QUX_MAIL_HOST=${QUX_MAIL_HOST}
      - QUX_JWT_PASSWORD=${QUX_JWT_PASSWORD}
      - QUX_IMAGE_FOLDER_USER=/app-data/qux-images
      - QUX_IMAGE_FOLDER_APPS=/app-data/qux-image-apps
      - TZ=${TZ}
      - QUX_AUTH_SERVICE=${QUX_AUTH_SERVICE}
      - QUX_KEYCLOAK_SERVER=${QUX_KEYCLOAK_SERVER}
      - QUX_KEYCLOAK_REALM=${QUX_KEYCLOAK_REALM}
      - QUX_USER_ALLOW_SIGNUP=${QUX_USER_ALLOW_SIGNUP}
      - QUX_USER_ALLOWED_DOMAINS=${QUX_USER_ALLOWED_DOMAINS}
    depends_on:
      - mongo

  qux-ws:
    restart: always
    image: klausenschaefersinho/quant-ux-websocket
    environment:
      - QUX_SERVER=http://quant-ux-backend:8080/
      - QUX_SERVER_PORT=8086
    ports:
      - 8086
    links:
      - qux-be
    depends_on:
      - qux-be

volumes:
  mongo_data:
  quant_ux_data:

