Stack Compose Clamav demon et interface REST
The snippet can be accessed without any authentication.
Authored by
erwan.salmon
Encapsulation dans une stack Docker de l'image Clamav https://hub.docker.com/r/clamav/clamav Par défaut le démon Clamd écoute sur son port habituel (3310) et peut être appelé par les clients usuels.
Pré-requis : créer un volume docker nommé clamav-db
$ docker volume create clam_db
Exemples de librairies Clamav
- Python : https://pypi.org/project/pyClamd/
- Java : https://github.com/solita/clamav-java
- Nodejs : https://www.npmjs.com/package/clamscan
La stack contient aussi un exemple d'interface REST https://github.com/benzino77/clamav-rest-api. Une utilisation directe via une librairie du langage choisi est probablement tout aussi simple et plus performante.
version: "3"
services:
# Démon Clamav-
clamav:
image: clamav/clamav:stable
restart: unless-stopped
ports:
- 3310:3310
volumes:
- type: volume
source: clamav-db
target: /var/lib/clamav
networks:
clam-net:
# Interface REST - https://github.com/benzino77/clamav-rest-api
clamav-rest-js:
image: benzino77/clamav-rest-api
restart: unless-stopped
ports:
- 8081:3000
depends_on:
- clamav
environment:
- NODE_ENV=production
- CLAMD_IP=clamav
- APP_FORM_KEY=FILES
- APP_PORT=3000
networks:
clam-net:
volumes:
# Le volume clamav permet de conserver la base de signature sur la durée
clamav-db:
networks:
Please register or sign in to comment