forked from fbonalair/traefik-crowdsec-bouncer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-test.yaml
61 lines (55 loc) · 1.56 KB
/
docker-compose-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: "3.8"
services:
traefik:
image: "traefik:v2.5"
container_name: "traefik"
command:
# - "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
whoami:
image: traefik/whoami
container_name: "simple-service"
labels:
# Create bouncer middleware
- "traefik.http.middlewares.crowdsec-bouncer.forwardauth.address=http://api:8082/api/v1/forwardAuth"
# Traefik routing to this service
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`localhost`)"
- "traefik.http.routers.whoami.entrypoints=web"
- "traefik.http.routers.whoami.middlewares=crowdsec-bouncer@docker"
crowdsec:
image: crowdsecurity/crowdsec:v1.2.0
environment:
COLLECTIONS: "crowdsecurity/nginx"
GID: "${GID-1000}"
depends_on:
- 'traefik'
volumes:
- ./crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml
- logs:/var/log/nginx
- crowdsec-db:/var/lib/crowdsec/data/
- crowdsec-config:/etc/crowdsec/
ports:
- "8083:8080"
api:
build: .
image: fbonalair/traefik-crowdsec-bouncer
container_name: bouncer
environment:
PORT: 8082
CROWDSEC_BOUNCER_API_KEY: 40796d93c2958f9e58345514e67740e5
CROWDSEC_AGENT_HOST: crowdsec:8083
ports:
- "8082:8080"
volumes:
logs:
crowdsec-db:
crowdsec-config: