Skip to content

Commit 3070afe

Browse files
committed
improve links
1 parent 9a7da36 commit 3070afe

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

crowdsec-docs/docs/appsec/quickstart/traefik.mdx

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
186184
appsec_config: crowdsecurity/appsec-desfault
@@ -190,37 +188,43 @@ listen_addr: 0.0.0.0:7422
190188
source: 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
201197
docker 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"
219222
appsec_config: crowdsecurity/appsec-default
220223
labels:
221224
type: appsec
222225
listen_addr: 0.0.0.0:7422
223226
source: appsec
227+
```
224228

225229
Because 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:
229233
services:
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

236243
Once you have updated the compose file to include the volume mount and the updated environment variable, you can restart the container.

0 commit comments

Comments
 (0)