From 2900f7de967861dbd3c9e4c15ab112234b17f435 Mon Sep 17 00:00:00 2001 From: ftoppi Date: Fri, 29 Mar 2024 16:25:01 +0100 Subject: [PATCH 1/3] Replace redis with keydb Due to Redis licensing not being opensource anymore, here's a drop-in replacement with an opensource license. Source: https://redis.com/blog/redis-adopts-dual-source-available-licensing/ https://github.com/Snapchat/KeyDB/blob/main/COPYING --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 96cdde7..6998b2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: - "SMARTHOST_ALIASES=${SMARTHOST_ALIASES}" redis: - image: redis:7.2 + image: eqalpha/keydb:x86_64_v6.3.4 db: # We use MariaDB because it supports ARM and has the expected collations From c0a1eda4073274a95700fea07b9c75a900220b1d Mon Sep 17 00:00:00 2001 From: ftoppi Date: Fri, 29 Mar 2024 16:26:52 +0100 Subject: [PATCH 2/3] Update docker-compose.yml: add healthchecks Added healthchecks for redis, db and misp-core services. misp-core and misp-modules now wait for redis and db to be healthy before starting. --- docker-compose.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6998b2d..df4b25a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,12 @@ services: redis: image: eqalpha/keydb:x86_64_v6.3.4 + healthcheck: + test: keydb-cli ping || exit 1 + interval: 2s + timeout: 1s + retries: 3 + start_period: 30s db: # We use MariaDB because it supports ARM and has the expected collations @@ -27,6 +33,12 @@ services: - mysql_data:/var/lib/mysql cap_add: - SYS_NICE # CAP_SYS_NICE Prevent runaway mysql log + healthcheck: + test: mysqladmin --user=$$MYSQL_USER --password=$$MYSQL_PASSWORD status + interval: 2s + timeout: 1s + retries: 3 + start_period: 30s misp-core: image: ghcr.io/misp/misp-docker/misp-core:latest @@ -46,8 +58,16 @@ services: - PYPI_CYBOX_VERSION=${PYPI_CYBOX_VERSION} - PYPI_PYMISP_VERSION=${PYPI_PYMISP_VERSION} depends_on: - - redis - - db + redis: + condition: service_healthy + db: + condition: service_healthy + healthcheck: + test: curl -ks https://localhost/users/login > /dev/null || exit 1 + interval: 2s + timeout: 1s + retries: 3 + start_period: 30s ports: - "80:80" - "443:443" @@ -126,7 +146,8 @@ services: environment: - "REDIS_BACKEND=redis" depends_on: - - redis + redis: + condition: service_healthy volumes: mysql_data: From 9229617ffd1abab37a0eb987b57f59fb3a683a58 Mon Sep 17 00:00:00 2001 From: ftoppi Date: Sun, 21 Apr 2024 15:44:52 +0200 Subject: [PATCH 3/3] use valkey instead --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index df4b25a..22c6c97 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,9 +12,9 @@ services: - "SMARTHOST_ALIASES=${SMARTHOST_ALIASES}" redis: - image: eqalpha/keydb:x86_64_v6.3.4 + image: valkey/valkey:7.2 healthcheck: - test: keydb-cli ping || exit 1 + test: valkey-cli ping || exit 1 interval: 2s timeout: 1s retries: 3