From ef3b51a3b29713cfda4d0225519e9bc105eac44f Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 09:36:07 +0200 Subject: [PATCH 1/8] refac: remove symlink and optimize the docker compose with yaml anchors --- src/_static/compose.yaml | 94 ++++++++++++++-------------------- src/_static/docker-compose.yml | 1 - 2 files changed, 39 insertions(+), 56 deletions(-) delete mode 120000 src/_static/docker-compose.yml diff --git a/src/_static/compose.yaml b/src/_static/compose.yaml index a3cf4813..7f5732ed 100644 --- a/src/_static/compose.yaml +++ b/src/_static/compose.yaml @@ -1,39 +1,43 @@ -name: greenbone-community-edition +# YAML Anchors +x-keepalive: &keepalive + KEEP_ALIVE: 1 +x-feed: &feed + FEED_RELEASE: "25.0" +name: greenbone-ce services: vulnerability-tests: image: registry.community.greenbone.net/community/vulnerability-tests environment: - FEED_RELEASE: "24.10" - KEEP_ALIVE: 1 + <<: [*feed, *keepalive] volumes: - vt_data_vol:/mnt notus-data: image: registry.community.greenbone.net/community/notus-data environment: - KEEP_ALIVE: 1 + <<: *keepalive volumes: - notus_data_vol:/mnt scap-data: image: registry.community.greenbone.net/community/scap-data environment: - KEEP_ALIVE: 1 + <<: *keepalive volumes: - scap_data_vol:/mnt cert-bund-data: image: registry.community.greenbone.net/community/cert-bund-data environment: - KEEP_ALIVE: 1 + <<: *keepalive volumes: - cert_data_vol:/mnt dfn-cert-data: image: registry.community.greenbone.net/community/dfn-cert-data environment: - KEEP_ALIVE: 1 + <<: *keepalive volumes: - cert_data_vol:/mnt depends_on: @@ -43,16 +47,14 @@ services: data-objects: image: registry.community.greenbone.net/community/data-objects environment: - FEED_RELEASE: "24.10" - KEEP_ALIVE: 1 + <<: [*feed, *keepalive] volumes: - data_objects_vol:/mnt report-formats: image: registry.community.greenbone.net/community/report-formats environment: - FEED_RELEASE: "24.10" - KEEP_ALIVE: 1 + <<: [*feed, *keepalive] volumes: - data_objects_vol:/mnt depends_on: @@ -66,17 +68,13 @@ services: redis-server: image: registry.community.greenbone.net/community/redis-server - deploy: - restart_policy: - condition: any + restart: unless-stopped volumes: - redis_socket_vol:/run/redis/ pg-gvm: image: registry.community.greenbone.net/community/pg-gvm:stable - deploy: - restart_policy: - condition: any + restart: unless-stopped volumes: - psql_data_vol:/var/lib/postgresql - psql_socket_vol:/var/run/postgresql @@ -86,18 +84,14 @@ services: pg-gvm-migrator: image: registry.community.greenbone.net/community/pg-gvm-migrator:stable - deploy: - restart_policy: - condition: none + restart: no volumes: - psql_data_vol:/var/lib/postgresql - psql_socket_vol:/var/run/postgresql gvmd: image: registry.community.greenbone.net/community/gvmd:stable - deploy: - restart_policy: - condition: any + restart: unless-stopped volumes: - gvmd_data_vol:/var/lib/gvm - scap_data_vol:/var/lib/gvm/scap-data/ @@ -126,7 +120,7 @@ services: image: registry.community.greenbone.net/community/gsa:stable-slim environment: MOUNT_PATH: "/mnt/web" - KEEP_ALIVE: 1 + <<: *keepalive healthcheck: test: [ "CMD-SHELL", "test -e /run/gsa/copying.done" ] start_period: 5s @@ -135,9 +129,7 @@ services: gsad: image: registry.community.greenbone.net/community/gsad:stable - deploy: - restart_policy: - condition: any + restart: unless-stopped environment: GSAD_HTTP_ONLY: "true" GSAD_API_ONLY: "true" @@ -159,6 +151,7 @@ services: nginx: image: registry.community.greenbone.net/community/nginx:latest + restart: unless-stopped ports: - 127.0.0.1:443:443 - 127.0.0.1:9392:9392 @@ -166,9 +159,6 @@ services: - nginx_config_vol:/etc/nginx/conf.d:ro - nginx_certificates_vol:/etc/nginx/certs:ro - gsa_data_vol:/usr/share/nginx/html:ro - deploy: - restart_policy: - condition: any depends_on: gvm-config: condition: service_completed_successfully @@ -191,32 +181,12 @@ services: - | printf "table_driven_lsc = yes\nopenvasd_server = http://openvasd:80\n" > /mnt/openvas.conf sed "s/127/128/" /etc/openvas/openvas_log.conf | sed 's/gvm/openvas/' > /mnt/openvas_log.conf - chmod 644 /mnt/openvas.conf - chmod 644 /mnt/openvas_log.conf touch /var/log/openvas/openvas.log - chmod 666 /var/log/openvas/openvas.log - - # shows logs of openvas - openvas: - image: registry.community.greenbone.net/community/openvas-scanner:stable - volumes: - - openvas_data_vol:/etc/openvas - - openvas_log_data_vol:/var/log/openvas - command: - - /bin/sh - - -c - - | - cat /etc/openvas/openvas.conf - tail -f /var/log/openvas/openvas.log - depends_on: - configure-openvas: - condition: service_completed_successfully + chmod 644 /mnt/openvas.conf /mnt/openvas_log.conf /var/log/openvas/openvas.log openvasd: image: registry.community.greenbone.net/community/openvas-scanner:stable - deploy: - restart_policy: - condition: any + restart: unless-stopped environment: # `service_notus` is set to disable everything but notus, # if you want to utilize openvasd directly, remove `OPENVASD_MODE` @@ -245,11 +215,25 @@ services: aliases: - openvasd + # shows logs of openvas + openvas-logger: + image: registry.community.greenbone.net/community/openvas-scanner:stable + volumes: + - openvas_data_vol:/etc/openvas + - openvas_log_data_vol:/var/log/openvas + command: + - /bin/sh + - -c + - | + cat /etc/openvas/openvas.conf + tail -f /var/log/openvas/openvas.log + depends_on: + configure-openvas: + condition: service_completed_successfully + ospd-openvas: image: registry.community.greenbone.net/community/ospd-openvas:stable - deploy: - restart_policy: - condition: any + restart: unless-stopped hostname: ospd-openvas.local cap_add: - NET_ADMIN # for capturing packages in promiscuous mode diff --git a/src/_static/docker-compose.yml b/src/_static/docker-compose.yml deleted file mode 120000 index 577ffa64..00000000 --- a/src/_static/docker-compose.yml +++ /dev/null @@ -1 +0,0 @@ -compose.yaml \ No newline at end of file From 20b4d96055de816edd0fb09133fa9ffdca33a9d9 Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 09:41:04 +0200 Subject: [PATCH 2/8] chore: add changelog addition --- src/changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/changelog.md b/src/changelog.md index 02885ddc..d031e1f6 100644 --- a/src/changelog.md +++ b/src/changelog.md @@ -23,6 +23,7 @@ and this project adheres to [Calendar Versioning](https://calver.org). * Use [`restart_policy`](https://docs.docker.com/reference/compose-file/deploy/#restart_policy) for container services * Use `compose.yaml` instead of `docker-compose.yml` everywhere in the docs * Use environment variables for the settings of gsad +* Refactored the Docker compose to use yaml anchors ## 26.2.0 - 2026-02-24 From dd5e38e28adda161fe9794eb641ad3db84c2f699 Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 09:48:40 +0200 Subject: [PATCH 3/8] chore: readd the symbolic link --- src/_static/docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) create mode 120000 src/_static/docker-compose.yaml diff --git a/src/_static/docker-compose.yaml b/src/_static/docker-compose.yaml new file mode 120000 index 00000000..577ffa64 --- /dev/null +++ b/src/_static/docker-compose.yaml @@ -0,0 +1 @@ +compose.yaml \ No newline at end of file From cdafebf5f1cb6912a766cc42976ab54c97c0e6fd Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 09:51:04 +0200 Subject: [PATCH 4/8] chore: rename openvas-logger back to openvas --- src/_static/compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_static/compose.yaml b/src/_static/compose.yaml index 7f5732ed..b9f3bb05 100644 --- a/src/_static/compose.yaml +++ b/src/_static/compose.yaml @@ -216,7 +216,7 @@ services: - openvasd # shows logs of openvas - openvas-logger: + openvas: image: registry.community.greenbone.net/community/openvas-scanner:stable volumes: - openvas_data_vol:/etc/openvas From ea4344b1a70ff8bade3c46f09b9518715c8e2464 Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 09:59:43 +0200 Subject: [PATCH 5/8] chore: reset version to current value --- src/_static/compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_static/compose.yaml b/src/_static/compose.yaml index b9f3bb05..4a972d6e 100644 --- a/src/_static/compose.yaml +++ b/src/_static/compose.yaml @@ -2,7 +2,7 @@ x-keepalive: &keepalive KEEP_ALIVE: 1 x-feed: &feed - FEED_RELEASE: "25.0" + FEED_RELEASE: "24.10" name: greenbone-ce services: From 3ed6d235ec22d6333882448639f1cee69a0c9b86 Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 14:58:58 +0200 Subject: [PATCH 6/8] chore: properly revert --- src/_static/{docker-compose.yaml => docker-compose.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/_static/{docker-compose.yaml => docker-compose.yml} (100%) diff --git a/src/_static/docker-compose.yaml b/src/_static/docker-compose.yml similarity index 100% rename from src/_static/docker-compose.yaml rename to src/_static/docker-compose.yml From 2b8455901e5c6fd395b5a5b9e7f7363f639a28e7 Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 16:17:35 +0200 Subject: [PATCH 7/8] chore: add an expose entry in the compose --- src/_static/compose.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/_static/compose.yaml b/src/_static/compose.yaml index 4a972d6e..f9af0b61 100644 --- a/src/_static/compose.yaml +++ b/src/_static/compose.yaml @@ -69,6 +69,8 @@ services: redis-server: image: registry.community.greenbone.net/community/redis-server restart: unless-stopped + expose: + - 6379 volumes: - redis_socket_vol:/run/redis/ From 5312f33a9a5c5f5575b308922b98811f674cd5a1 Mon Sep 17 00:00:00 2001 From: Daan Date: Fri, 10 Jul 2026 16:54:13 +0200 Subject: [PATCH 8/8] chore: rectify compliance --- src/_static/compose.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_static/compose.yaml b/src/_static/compose.yaml index f9af0b61..af1bdc1f 100644 --- a/src/_static/compose.yaml +++ b/src/_static/compose.yaml @@ -184,7 +184,8 @@ services: printf "table_driven_lsc = yes\nopenvasd_server = http://openvasd:80\n" > /mnt/openvas.conf sed "s/127/128/" /etc/openvas/openvas_log.conf | sed 's/gvm/openvas/' > /mnt/openvas_log.conf touch /var/log/openvas/openvas.log - chmod 644 /mnt/openvas.conf /mnt/openvas_log.conf /var/log/openvas/openvas.log + chmod 644 /mnt/openvas.conf /mnt/openvas_log.conf + chmod 666 /var/log/openvas/openvas.log openvasd: image: registry.community.greenbone.net/community/openvas-scanner:stable