From 43a121f302c4adf6b13aee878509fbf7afa72330 Mon Sep 17 00:00:00 2001 From: Mark Petersen Date: Tue, 18 Jul 2023 14:15:02 +0200 Subject: [PATCH 1/2] Add Docker Compose file to ease deployment Add Docker Compose instructions to the README.md --- README.md | 32 +++++++++++++++++++++++++++++++- compose.yaml | 18 ++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 compose.yaml diff --git a/README.md b/README.md index bc3545f..c265f1b 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ You can test it by running `freshclam` or `freshclam.exe` locally, where you've DatabaseMirror http://localhost:8000 ``` -### Use docker +## Use docker Build docker image @@ -338,6 +338,36 @@ docker run -d \ -e CRON='0 0 * * *' \ cvdupdate:latest ``` +## Use Docker compose + +Edit the compose file if you need to change the default values: + +* Port 8000 +* USER_ID=0 +* CRON=30 */4 * * * + +### Build +``` +docker compose build +``` + +### Start +``` +docker compose up -d +``` + +### Stop +``` +docker compose down +``` + +### Volumes +Volumes are defined in the composefile and will be autocreated on `docker compose up` +``` +DRIVER VOLUME NAME +local cvdupdate_database +local cvdupdate_log +``` ## Contribute diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..fae06ed --- /dev/null +++ b/compose.yaml @@ -0,0 +1,18 @@ +services: + cvdupdate: + build: ./ + hostname: cvdupdate + container_name: cvdupdate + image: cvdupdate:latest + ports: + - 8000:8000 + environment: + - CRON=30 */4 * * * + - USER_ID=0 + volumes: + - database:/cvdupdate/database + - log:/cvdupdate/logs + +volumes: + database: + log: From 1841f2aee37059de33f0a8cc7d655d42ccb592e6 Mon Sep 17 00:00:00 2001 From: Tom Judge Date: Fri, 20 Sep 2024 15:29:42 +0000 Subject: [PATCH 2/2] Add apache instance to the docker-compose setup to serve the mirror Update README.md: - Add information about volumes. - Better explanation of the docker compose setup. Co-authored-by: Micah Snyder --- README.md | 16 ++++++++++------ compose.yaml | 9 +++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c265f1b..4de183d 100644 --- a/README.md +++ b/README.md @@ -338,31 +338,35 @@ docker run -d \ -e CRON='0 0 * * *' \ cvdupdate:latest ``` -## Use Docker compose +## Use Docker Compose -Edit the compose file if you need to change the default values: +A Docker `compose.yaml` is provided to: +1. Regularly update a Docker volume with the latest ClamAV databases. +2. Serve a database mirror on port 8000 using the Apache webserver. + +Edit the `compose.yaml` file if you need to change the default values: * Port 8000 * USER_ID=0 * CRON=30 */4 * * * ### Build -``` +```bash docker compose build ``` ### Start -``` +```bash docker compose up -d ``` ### Stop -``` +```bash docker compose down ``` ### Volumes -Volumes are defined in the composefile and will be autocreated on `docker compose up` +Volumes are defined in `compose.yaml` and will be auto-created when you run `docker compose up` ``` DRIVER VOLUME NAME local cvdupdate_database diff --git a/compose.yaml b/compose.yaml index fae06ed..07c4c43 100644 --- a/compose.yaml +++ b/compose.yaml @@ -4,14 +4,19 @@ services: hostname: cvdupdate container_name: cvdupdate image: cvdupdate:latest - ports: - - 8000:8000 environment: - CRON=30 */4 * * * - USER_ID=0 volumes: - database:/cvdupdate/database - log:/cvdupdate/logs + ## Apache instance to serve the mirror + apache: + image: httpd:2.4 + volumes: + - database:/usr/local/apache2/htdocs + ports: + - 8000:80 volumes: database: