From 4121da55477e10d65c970120b10eb690f7a7faf4 Mon Sep 17 00:00:00 2001 From: "Ralf G. R. Bergs" Date: Tue, 7 Apr 2026 18:22:23 +0200 Subject: [PATCH] Update clamav.yml: make OpenCloud container depend on ClamAV container. Prevent race condition between the two containers: If OpenCloud container is up quicker than clamd.sock exists, it doesn't work. --- antivirus/clamav.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/antivirus/clamav.yml b/antivirus/clamav.yml index 3878fec5..a3f0e79a 100644 --- a/antivirus/clamav.yml +++ b/antivirus/clamav.yml @@ -12,6 +12,9 @@ services: ANTIVIRUS_SCANNER_TYPE: clamav volumes: - clamav-socket:/var/run/clamav + depends_on: + clamav: + condition: service_healthy clamav: image: clamav/clamav:${CLAMAV_DOCKER_TAG:-latest} environment: @@ -26,6 +29,10 @@ services: logging: driver: ${LOG_DRIVER:-local} restart: always + healthcheck: + test: sh -c "[ -S /tmp/clamd.sock ]" + timeout: 1s + retries: 20 volumes: clamav-db: clamav-socket: