@@ -178,9 +178,7 @@ In the directory where you persist configuration files, create an `appsec.yaml`
178178
179179**Steps**
180180
181- 1. Change to the directory where you ran the `docker run` or `docker compose` command.
182- 2. Create a file named `appsec.yaml` in this directory.
183- 3. Add the following content :
181+ Create a file named `appsec.yaml` with the following content
184182
185183` ` ` yaml title="appsec.yaml"
186184appsec_config: crowdsecurity/appsec-desfault
@@ -190,37 +188,43 @@ listen_addr: 0.0.0.0:7422
190188source: appsec
191189` ` `
192190
193- Because CrowdSec runs inside a container, set listen_addr to 0.0.0.0 instead of
194- 127.0.0.1 so it can accept connections from outside the container.
195-
196- Edit your docker run command to mount the file :
197-
198- If a crowdsec container is already running, stop/remove it before re-running with the updated mounts.
191+ Either you create with file in `/etc/crowdsec/acquis.d` following this
192+ [directory hierarchy](u/getting_started/installation/docker/#docker) and the run
193+ command doesn't change or you create this file some where else and mount it like
194+ this :
199195
200196` ` ` bash
201197docker run -d --name crowdsec \
202- -v /path/to/original :/etc/crowdsec \
203- -v . /appsec.yaml:/etc/crowdsec/acquis.d/appsec.yaml \
198+ -v /etc/crowdsec :/etc/crowdsec \
199+ -v /etc/crowdsec/acquis.d /appsec.yaml:/etc/crowdsec/acquis.d/appsec.yaml \
204200 crowdsecurity/crowdsec
205201` ` `
206202
203+
204+ Because CrowdSec runs inside a container, set listen_addr to 0.0.0.0 instead of
205+ 127.0.0.1 so it can accept connections from outside the container.
206+
207+ If a crowdsec container is already running, stop/remove it before re-running
208+ with the updated acquisition.
209+
210+
207211</TabItem>
208212
209213<TabItem value="dockerCompose">
210214
211- In the directory where you persist configuration files, create an appsec.yaml file and mount it into the container.
215+ In the directory where you persist configuration files `./crowdsec` (when
216+ following this [directory
217+ hierarchy](u/getting_started/installation/docker/#compose) create an appsec.yaml
218+ file and mount it into the container.
212219
213- **Steps**
214-
215- 1. Change to the directory where you ran the docker compose (or docker run) command.
216- 2. Create a file named appsec.yaml in this directory.
217- 3. Add the following content to the `appsec.yaml`
218220
221+ ` ` ` yaml title="appsec.yaml"
219222appsec_config: crowdsecurity/appsec-default
220223labels:
221224 type: appsec
222225listen_addr: 0.0.0.0:7422
223226source: appsec
227+ ` ` `
224228
225229Because CrowdSec runs in a container, set listen_addr to 0.0.0.0 (not 127.0.0.1) so it listens on the container’s network interface.
226230
@@ -229,8 +233,11 @@ Mount the file in your Compose service:
229233services:
230234 crowdsec:
231235 volumes:
232- - /path/to/original:/etc/crowdsec # or a named volume
233- - ./appsec.yaml:/etc/crowdsec/acquis.d/appsec.yaml
236+ - ./crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml
237+ - logs:/var/log/nginx
238+ - crowdsec-db:/var/lib/crowdsec/data/
239+ - crowdsec-config:/etc/crowdsec/
240+ - ./crowdsec/acquis.d/appsec.yaml:/etc/crowdsec/acquis.d/appsec.yaml
234241` ` `
235242
236243Once you have updated the compose file to include the volume mount and the updated environment variable, you can restart the container.
0 commit comments