forked from fbonalair/traefik-crowdsec-bouncer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
66 lines (60 loc) · 1.88 KB
/
docker-compose.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
62
63
64
65
66
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"
volumes:
# - "/var/run/docker.sock:/var/run/docker.sock:ro" # Docker standard mode
- "/run/user/1000/docker.sock:/var/run/docker.sock:ro" # Docker in rootless mode
network_mode: host
whoami:
image: traefik/whoami
container_name: "simple-service"
labels:
# Create bouncer middleware
- "traefik.http.middlewares.crowdsec-bouncer.forwardauth.address=http://127.0.0.1:8081/api/v1/forwardAuth"
- "traefik.http.middlewares.crowdsec-bouncer.forwardauth.trustForwardHeader=true"
# Traefik routing to this service
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`localhost`, `192.168.1.80`)"
- "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"
# dashboard:
# build: ./crowdsec/dashboard
# ports:
# - 3000:3000
# environment:
# MB_DB_FILE: /data/metabase.db
# MGID: "${GID-1000}"
# depends_on:
# - 'crowdsec'
# volumes:
# - crowdsec-db:/metabase-data/
## networks:
## crowdsec_test:
## ipv4_address: 172.20.0.5
# # credentials: [email protected] and !!Cr0wdS3c_M3t4b4s3??
volumes:
logs:
crowdsec-db:
crowdsec-config: