services:
engine:
image: crowdsecurity/crowdsec:v1.8.1@sha256:0f2523fa61ef507f15d953045cface490cc880670c62f2755ced17524107f71a
labels:
- AH.CS.PVE=true
deploy:
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
restart: unless-stopped
ports:
- ${CROWDSEC_PORT:-8080}:8080
depends_on:
init:
condition: service_completed_successfully
environment:
- COLLECTIONS=crowdsecurity/linux crowdsecurity/sshd crowdsecurity/linux-lpe crowdsecurity/iptables fulljackz/proxmox
- ENROLL_INSTANCE_NAME=${CROWDSEC_NAME}
- BOUNCER_KEY_FIREWALL=${BOUNCER_KEY}
- DISABLE_LOCAL_API=false
- DISABLE_ONLINE_API=false
- ENROLL_KEY=${CROWDSEC_ENROLL_KEY}
volumes:
- data:/var/lib/crowdsec/data
- config:/etc/crowdsec
- bouncer:/etc/bouncer-shared
- /var/log:/var/log:ro
healthcheck:
test: ["CMD", "cscli", "version"]
interval: 15s
timeout: 10s
retries: 5
networks:
crowdsec:
aliases:
- crowdsec
bouncer:
image: ghcr.io/shgew/cs-firewall-bouncer-docker:v0.0.36@sha256:4a7bd2e3eda81f9382f6e8571cebff7192e9b300e99d1cd5993b3b03580a0cb8
labels:
- AH.CS.PVE=true
deploy:
restart_policy:
condition: on-failure
delay: 60s
max_attempts: 6
window: 60s
restart: unless-stopped
network_mode: host
depends_on:
engine:
condition: service_healthy
cap_add:
- NET_ADMIN
- NET_RAW
security_opt:
- no-new-privileges:true
environment:
- API_URL=http://localhost:${CROWDSEC_PORT:-8080}/
- API_KEY=${BOUNCER_KEY}
volumes:
- bouncer:/config:rw
- /etc/localtime:/etc/localtime:ro
init:
image: alpine:3.24.1
volumes:
- config:/etc/crowdsec
- bouncer:/etc/crowdsec/bouncers
command: >
sh -c "apk add --no-cache wget ca-certificates &&
mkdir -p /etc/crowdsec/acquisitions.d /etc/crowdsec/bouncers &&
wget -qO /etc/crowdsec/acquisitions.d/pve.yaml https://raw.githubusercontent.com/trentnbauer/HomelabPublic/main/crowdsec/pve.yaml &&
wget -qO /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml https://raw.githubusercontent.com/trentnbauer/HomelabPublic/main/crowdsec/crowdsec-firewall-bouncer.yaml"
autoheal:
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 30s
max_attempts: 5
window: 120s
environment:
AUTOHEAL_CONTAINER_LABEL: AH.CS.PVE
AUTOHEAL_INTERVAL: 60
AUTOHEAL_START_PERIOD: 240
AUTOHEAL_DEFAULT_STOP_TIMEOUT: 60
WEBHOOK_URL: ${AUTOHEAL_WEBHOOK:-}
image: willfarrell/autoheal@sha256:a8c1d6a75f44783d76e213d679117a88d3b1539c72b56a673e066312bb164da7
restart: always
network_mode: none
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
networks:
crowdsec:
volumes:
config:
data:
bouncer: