Closed w24rdl closed 8 months ago
sed: cannot rename /data/crowdsec/sed68C3rj: Device or resource busy
I dont believe it an issue with the actual configuration, it an issue within the startup command to sed replace a value. Most likely this line might be best to open an issue directly in the repo than here.
I managed to get this working after some trial and error. I had to remove the following line from the docker-compose.yml
- /swarmvol/crowdsec/crowdsec-openresty-bouncer.conf:/data/crowdsec/crowdsec-openresty-bouncer.conf
then add the following environment items:
environment:
CROWDSEC_LAPI: "http://crowdsec:8080"
CROWDSEC_KEY: "<API-KEY-GOES-HERE>"
and then manually edit the crowdsec-openresty-bouncer.conf
located within /data/crowdsec/
on the npm container to have ENABLED=true
(Leaving the rest of the file as defaults)
I think the way im mounting the crowdsec-openresty-bouncer.conf
file to the npm container is causing issues with sed.
What my docker-compose.yml looks like now:
version: '3'
services:
app:
#image: 'jc21/nginx-proxy-manager:latest'
image: 'lepresidente/nginxproxymanager:latest'
#image: 'lepresidente/nginxproxymanager:debug'
restart: unless-stopped
networks:
crowdsec:
nginx:
ports:
# These ports are in format :
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
environment:
CROWDSEC_LAPI: "http://crowdsec:8080"
CROWDSEC_KEY: "supersecret"
# Uncomment this if IPv6 is not enabled on your host
DISABLE_IPV6: 'true'
volumes:
- /swarmvol/npm/data:/data
#- /swarmvol/crowdsec/crowdsec-openresty-bouncer.conf:/data/crowdsec/crowdsec-openresty-bouncer.conf
- /swarmvol/npm/letsencrypt:/etc/letsencrypt
security_opt:
- no-new-privileges=true
crowdsec:
image: docker.io/crowdsecurity/crowdsec:latest
container_name: crowdsec
environment:
- COLLECTIONS=crowdsecurity/nginx-proxy-manager
volumes:
- /swarmvol/crowdsec/crowdsec-db:/var/lib/crowdsec/data/
- /swarmvol/crowdsec/config:/etc/crowdsec/
- /swarmvol/npm/data/logs/:/var/log/npm:ro
- /swarmvol/crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml
networks:
crowdsec:
restart: unless-stopped
security_opt:
- no-new-privileges=true
networks:
nginx:
external: true
crowdsec:
external: true
Trying to get the NPM example up and running from here.
When starting the docker compose stack, the NPM container fails with the following
The full log file is:
the docker-compose.yaml is as follows
Note im using a 3 node docker swarm cluster with
/swarmvol
being a truenas NFS mount to all hosts.If it remove the following volume mount, the container starts as expected, but crowdsec is not enabled.
So it seems to me that something is the matter with this config file, I have tied multiple changes within
crowdsec-openresty-bouncer.conf
, including leaving it just asENABLED=true
, but each time the same error as above occurs.Any idea what im doing wrong here?
Docker version
Ubuntu 20.04.6 LTS