From 7925228f979a0eb49e8ca86bdaa1ee25cefd7184 Mon Sep 17 00:00:00 2001 From: Hermann Kao <38349706+itishermann@users.noreply.github.com> Date: Fri, 27 Oct 2023 01:41:07 +0200 Subject: [PATCH] add service template for sonarqube --- templates/compose/sonarqube.yaml | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 templates/compose/sonarqube.yaml diff --git a/templates/compose/sonarqube.yaml b/templates/compose/sonarqube.yaml new file mode 100644 index 000000000..76e9bb78d --- /dev/null +++ b/templates/compose/sonarqube.yaml @@ -0,0 +1,35 @@ +# documentation: https://hub.docker.com/_/sonarqube/ +# slogan: SonarQube is a self-managed, automatic code review tool that systematically helps you deliver Clean Code +# tags: sonarqube, code-review, clean-code, quality, code-quality, code-analysis, code-smells, code-coverage, code-security + +services: + sonarqube: + image: sonarqube:community + hostname: sonarqube + container_name: sonarqube + environment: + - SONAR_JDBC_URL=jdbc:postgresql://postgresql:5432/${POSTGRES_DB:-sonar} + - SONAR_JDBC_USERNAME=$SERVICE_USER_POSTGRES + - SONAR_JDBC_PASSWORD=$SERVICE_PASSWORD_POSTGRES + - SERVICE_FQDN_SONARQUBE_9000 + volumes: + - sonarqube_data:/opt/sonarqube/data + - sonarqube_extensions:/opt/sonarqube/extensions + - sonarqube_logs:/opt/sonarqube/logs + depends_on: + postgresql: + condition: service_healthy + postgresql: + image: postgres:15-alpine + volumes: + - postgresql-data:/var/lib/postgresql/data + environment: + - POSTGRES_USER=$SERVICE_USER_POSTGRES + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES + - POSTGRES_DB=${POSTGRES_DB:-sonar} + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] + interval: 5s + timeout: 20s + retries: 10 +