Feature/docker dbinit (#2371)

* Standalone tool for initializing of hawkBit Database

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Add docker build for dbinit

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-04-24 16:40:55 +03:00
committed by GitHub
parent 323738bda9
commit d2a41d1bff
29 changed files with 574 additions and 11 deletions

View File

@@ -0,0 +1,48 @@
#
# 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'
services:
# ---------------------
# MySQL service
# ---------------------
mysql:
image: "mysql:8.0"
environment:
MYSQL_DATABASE: "hawkbit"
# MYSQL_USER: "root" is created by default in the container for mysql 8.0+
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
restart: always
ports:
- "3306:3306"
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 20s
retries: 10
labels:
NAME: "mysql"
# ---------------------
# RabbitMQ service
# ---------------------
rabbitmq:
image: "rabbitmq:4-management-alpine"
hostname: "rabbitmq"
environment:
RABBITMQ_DEFAULT_VHOST: "/"
RABBITMQ_DEFAULT_USER: "guest"
RABBITMQ_DEFAULT_PASS: "guest"
ports:
- "15672:15672"
- "5672:5672"
deploy:
restart_policy:
condition: on-failure

View File

@@ -0,0 +1,106 @@
#
# 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 DB Init
# ---------------------
hawkbit-db-init:
image: "hawkbit/hawkbit-repository-jpa-init:latest"
environment:
- 'HAWKBIT_DB_MODE=migrate'
- 'SPRING_DATASOURCE_URL=jdbc:mariadb://mysql:3306/hawkbit'
- 'SPRING_DATASOURCE_USERNAME=root'
- 'AND_THEN=sleep infinity'
restart: always
healthcheck:
test: ["CMD", "pgrep", "sleep"]
start_period: 30s
interval: 10s
retries: 5
timeout: 60s
depends_on:
mysql:
condition: service_healthy
labels:
NAME: "hawkbit-db-init"
# ---------------------
# 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:
hawkbit-db-init:
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:
hawkbit-db-init:
condition: service_healthy
labels:
NAME: "hawkbit-dmf"
# ---------------------
# HawkBit MGMT
# ---------------------
hawkbit-mgmt:
image: "hawkbit/hawkbit-mgmt-server:latest"
environment:
- 'PROFILES=mysql'
- 'SPRING_FLYWAY_ENABLED=false'
- '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:
hawkbit-db-init:
condition: service_healthy
labels:
NAME: "hawkbit-mgmt"
volumes:
artifactrepo:
driver: local

View File

@@ -0,0 +1,82 @@
#
# 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

View File

@@ -0,0 +1,32 @@
#
# 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-micro-services-dbinit-mysql.yml
services:
# ---------------------
# HawkBit Simple UI
# ---------------------
hawkbit-simple-ui:
image: "hawkbit/hawkbit-simple-ui:latest"
environment:
- 'SPRING_APPLICATION_JSON={"hawkbit.server.mgmtUrl": "http://hawkbit-mgmt:8080"}'
restart: always
ports:
- 8088:8088
labels:
NAME: "hawkbit-simple-ui"
volumes:
artifactrepo:
driver: local

View File

@@ -0,0 +1,32 @@
#
# 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-micro-services-mysql.yml
services:
# ---------------------
# HawkBit Simple UI
# ---------------------
hawkbit-simple-ui:
image: "hawkbit/hawkbit-simple-ui:latest"
environment:
- 'SPRING_APPLICATION_JSON={"hawkbit.server.mgmtUrl": "http://hawkbit-mgmt:8080"}'
restart: always
ports:
- 8088:8088
labels:
NAME: "hawkbit-simple-ui"
volumes:
artifactrepo:
driver: local

View File

@@ -0,0 +1,66 @@
#
# 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'
include:
- docker-compose-deps-mysql.yml
services:
# ---------------------
# HawkBit DB Init
# ---------------------
hawkbit-db-init:
image: "hawkbit/hawkbit-repository-jpa-init:latest"
environment:
- 'HAWKBIT_DB_MODE=migrate'
- 'SPRING_DATASOURCE_URL=jdbc:mariadb://mysql:3306/hawkbit'
- 'SPRING_DATASOURCE_USERNAME=root'
- 'AND_THEN=sleep infinity'
restart: always
healthcheck:
test: ["CMD", "pgrep", "sleep"]
start_period: 30s
interval: 10s
retries: 5
timeout: 60s
depends_on:
mysql:
condition: service_healthy
labels:
NAME: "hawkbit-db-init"
# ---------------------
# HawkBit service
# ---------------------
hawkbit:
image: "hawkbit/hawkbit-update-server:latest"
environment:
- 'PROFILES=mysql'
- 'SPRING_FLYWAY_ENABLED=false'
- '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:
hawkbit-db-init:
condition: service_healthy
labels:
NAME: "hawkbit"
volumes:
artifactrepo:
driver: local

View File

@@ -0,0 +1,42 @@
#
# 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'
include:
- docker-compose-deps-mysql.yml
services:
# ---------------------
# HawkBit service
# ---------------------
hawkbit:
image: "hawkbit/hawkbit-update-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"
volumes:
artifactrepo:
driver: local

View File

@@ -0,0 +1,32 @@
#
# 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'
include:
- docker-compose-monolith-dbinit-mysql.yml
services:
# ---------------------
# HawkBit Simple UI service
# ---------------------
hawkbit-simple-ui:
image: "hawkbit/hawkbit-simple-ui:latest"
environment:
- 'SPRING_APPLICATION_JSON={"hawkbit.server.mgmtUrl": "http://hawkbit:8080"}'
restart: always
ports:
- 8088:8088
labels:
NAME: "hawkbit-simple-ui"
volumes:
artifactrepo:
driver: local

View File

@@ -0,0 +1,32 @@
#
# 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'
include:
- docker-compose-monolith-mysql.yml
services:
# ---------------------
# HawkBit Simple UI service
# ---------------------
hawkbit-simple-ui:
image: "hawkbit/hawkbit-simple-ui:latest"
environment:
- 'SPRING_APPLICATION_JSON={"hawkbit.server.mgmtUrl": "http://hawkbit:8080"}'
restart: always
ports:
- 8088:8088
labels:
NAME: "hawkbit-simple-ui"
volumes:
artifactrepo:
driver: local