From cee49570be1f41bad84a102d1a0f216e911a9a4f Mon Sep 17 00:00:00 2001 From: Suresh Khatri Date: Fri, 30 Aug 2024 08:49:40 +1000 Subject: [PATCH] Add kong and sonarqube --- README.md | 6 ++-- data/postgres/data/my_data.sql | 1 + docker-compose.yaml | 57 ++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8626068..b588af5 100644 --- a/README.md +++ b/README.md @@ -120,9 +120,11 @@ POSTGRES_USER=my-user POSTGRES_PASSWORD=my-password ./run.sh postgres ## Services -| Service Type | Service | Supported | -|-----------------------------|---------------------------|-----------| +| Service Type | Service | Supported | +|-----------------------------|---------------------------|------------| +| Api Gateway | kong | ✅ | | Change Data Capture | debezium | ✅ | +| Code Analysis | sonarqube | ✅ | | Database | cassandra | ✅ | | Database | cockroachdb | ✅ | | Database | elasticsearch | ✅ | diff --git a/data/postgres/data/my_data.sql b/data/postgres/data/my_data.sql index 3d554bf..3cbaccf 100644 --- a/data/postgres/data/my_data.sql +++ b/data/postgres/data/my_data.sql @@ -51,3 +51,4 @@ CREATE DATABASE prefect; CREATE DATABASE keycloak; CREATE DATABASE marquez; CREATE DATABASE druid; +CREATE DATABASE kong; diff --git a/docker-compose.yaml b/docker-compose.yaml index 845f04c..a3a74c6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -705,6 +705,51 @@ services: restart: always volumes: - "./data/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml" + + kong: + container_name: kong + depends_on: + kong-data: + condition: service_completed_successfully + postgres: + condition: service_completed_successfully + environment: + - KONG_DATABASE=postgres + - KONG_PG_HOST=postgres + - KONG_PG_USER=postgres + - KONG_PG_PASSWORD=postgres + - KONG_PROXY_ACCESS_LOG=/dev/stdout + - KONG_ADMIN_ACCESS_LOG=/dev/stdout + - KONG_PROXY_ERROR_LOG=/dev/stderr + - KONG_ADMIN_ERROR_LOG=/dev/stderr + - KONG_ADMIN_LISTEN=0.0.0.0:8001,0.0.0.0:8444 ssl + - KONG_PLUGINS=rate-limiting + healthcheck: + interval: 10s + retries: 5 + test: [CMD-SHELL, kong health] + timeout: 10s + image: "kong:${KONG_VERSION:-3.7.1}" + ports: + - 8001:8001 + - 8000:8000 + restart: unless-stopped + kong-data: + command: + - kong + - migrations + - bootstrap + container_name: kong-data + + depends_on: + postgres: + condition: service_completed_successfully + environment: + - KONG_DATABASE=postgres + - KONG_PG_HOST=postgres + - KONG_PG_USER=postgres + - KONG_PG_PASSWORD=postgres + image: kong:3.7.1 logstash: container_name: logstash depends_on: @@ -1140,6 +1185,18 @@ services: nofile: hard: 6592 soft: 2448 + sonarqube: + container_name: sonarqube + environment: + - SONAR_WEB_CONTEXT=/sonar + healthcheck: + interval: 10s + retries: 3 + test: [CMD-SHELL, "wget --spider localhost:9000/sonar"] + timeout: 10s + image: "sonarqube:${SONARQUBE_VERSION:-lts-community}" + ports: + - "9000:9000" spanner: container_name: spanner image: "gcr.io/cloud-spanner-emulator/emulator:${SPANNER_VERSION:-1.5.19}"