Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose from SDFIdk #61

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -338,6 +338,40 @@ docker run -d \
-e CRON='0 0 * * *' \
cvdupdate:latest
```
## Use Docker Compose

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 `compose.yaml` and will be auto-created when you run `docker compose up`
```
DRIVER VOLUME NAME
local cvdupdate_database
local cvdupdate_log
```

## Contribute

Expand Down
23 changes: 23 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
services:
cvdupdate:
build: ./
hostname: cvdupdate
container_name: cvdupdate
image: cvdupdate:latest
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:
log: