#
# Copyright (c) 2018 Bosch Software Innovations GmbH and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
version: '3.7'

include:
  - docker-compose-deps-mysql.yml

services:

  # ---------------------
  # HawkBit DDI
  # ---------------------
  hawkbit-ddi:
    image: "hawkbit/hawkbit-ddi-server:latest"
    environment:
      - 'PROFILES=mysql'
      - 'SPRING_DATASOURCE_URL=jdbc:mariadb://mysql:3306/hawkbit'
      - 'SPRING_DATASOURCE_USERNAME=root'
      - 'SPRING_RABBITMQ_HOST=rabbitmq'
      - 'SPRING_RABBITMQ_USERNAME=guest'
      - 'SPRING_RABBITMQ_PASSWORD=guest'
    restart: always
    ports:
      - "8081:8081"
    depends_on:
      mysql:
        condition: service_healthy
    labels:
      NAME: "hawkbit-ddi"

  # ---------------------
  # HawkBit DMF
  # ---------------------
  hawkbit-dmf:
    image: "hawkbit/hawkbit-dmf-server:latest"
    environment:
      - 'PROFILES=mysql'
      - 'SPRING_DATASOURCE_URL=jdbc:mariadb://mysql:3306/hawkbit'
      - 'SPRING_DATASOURCE_USERNAME=root'
      - 'SPRING_RABBITMQ_HOST=rabbitmq'
      - 'SPRING_RABBITMQ_USERNAME=guest'
      - 'SPRING_RABBITMQ_PASSWORD=guest'
    restart: always
    depends_on:
      mysql:
        condition: service_healthy
    labels:
      NAME: "hawkbit-dmf"

  # ---------------------
  # HawkBit MGMT
  # ---------------------
  hawkbit-mgmt:
    image: "hawkbit/hawkbit-mgmt-server:latest"
    environment:
      - 'PROFILES=mysql'
      - 'SPRING_DATASOURCE_URL=jdbc:mariadb://mysql:3306/hawkbit'
      - 'SPRING_DATASOURCE_USERNAME=root'
      - 'SPRING_RABBITMQ_HOST=rabbitmq'
      - 'SPRING_RABBITMQ_USERNAME=guest'
      - 'SPRING_RABBITMQ_PASSWORD=guest'
    volumes:
      - artifactrepo:/artifactrepo
    restart: always
    ports:
      - "8080:8080"
    depends_on:
      mysql:
        condition: service_healthy
    labels:
      NAME: "hawkbit-mgmt"

volumes:
  artifactrepo:
    driver: local
