-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
143 lines (136 loc) · 4.25 KB
/
docker-compose.yml
File metadata and controls
143 lines (136 loc) · 4.25 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
version: '3.8'
services:
# CrowdSec Manager - Web UI and API
crowdsec-manager:
build:
context: .
dockerfile: Dockerfile
container_name: crowdsec-manager
restart: unless-stopped
ports:
- "8080:8080"
environment:
- PORT=8080
- ENVIRONMENT=production
- LOG_LEVEL=info
- LOG_FILE=/app/logs/crowdsec-manager.log
- DOCKER_HOST=unix:///var/run/docker.sock
- COMPOSE_FILE=/app/docker-compose.yml
- PANGOLIN_DIR=/app
- CONFIG_DIR=/app/config
- DATABASE_PATH=/app/data/settings.db
# Traefik Configuration Paths
- TRAEFIK_DYNAMIC_CONFIG=/etc/traefik/dynamic_config.yml
- TRAEFIK_STATIC_CONFIG=/etc/traefik/traefik_config.yml
- TRAEFIK_ACCESS_LOG=/var/log/traefik/access.log
- TRAEFIK_ERROR_LOG=/var/log/traefik/traefik.log
# CrowdSec Configuration Paths
- CROWDSEC_ACQUIS_FILE=/etc/crowdsec/acquis.yaml
# Backup Configuration
- BACKUP_DIR=/app/backups
- RETENTION_DAYS=60
- INCLUDE_CROWDSEC=true
volumes:
# Docker socket for container management
- /var/run/docker.sock:/var/run/docker.sock
# Configuration files
- ./config:/app/config
# Docker compose file
- ./docker-compose.yml:/app/docker-compose.yml
# Backups
- ./backups:/app/backups
# Logs
- ./logs/app:/app/logs
# Database for settings
- ./data:/app/data
# Traefik logs (read-only access)
- ./logs/traefik:/var/log/traefik:ro
networks:
- crowdsec-network
depends_on:
- crowdsec
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.crowdsec-manager.rule=Host(`manager.localhost`)"
- "traefik.http.routers.crowdsec-manager.entrypoints=web"
- "traefik.http.services.crowdsec-manager.loadbalancer.server.port=8080"
# Pangolin service
pangolin:
image: fosrl/pangolin:latest
container_name: pangolin
restart: unless-stopped
networks:
- crowdsec-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.pangolin.rule=Host(`pangolin.localhost`)"
- "traefik.http.routers.pangolin.entrypoints=web"
# Gerbil service
gerbil:
image: fosrl/gerbil:latest
container_name: gerbil
restart: unless-stopped
networks:
- crowdsec-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.gerbil.rule=Host(`gerbil.localhost`)"
- "traefik.http.routers.gerbil.entrypoints=web"
# CrowdSec Security Engine
crowdsec:
image: crowdsecurity/crowdsec:latest
container_name: crowdsec
restart: unless-stopped
environment:
- GID=${GID-1000}
- COLLECTIONS=crowdsecurity/linux crowdsecurity/traefik
volumes:
- ./config/crowdsec/acquis.yaml:/etc/crowdsec/acquis.yaml:ro
- crowdsec-db:/var/lib/crowdsec/data/
- crowdsec-config:/etc/crowdsec/
- ./logs/traefik:/var/log/traefik:ro
networks:
- crowdsec-network
labels:
- "traefik.enable=false"
# Traefik Reverse Proxy
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
stop_grace_period: 60s
ports:
- "80:80"
- "443:443"
- "8081:8080" # Traefik dashboard
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.file.directory=/etc/traefik"
- "--providers.file.watch=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.transport.lifecycle.gracetimeout=60s"
- "--entrypoints.websecure.transport.lifecycle.gracetimeout=60s"
- "--accesslog=true"
- "--accesslog.filepath=/var/log/traefik/access.log"
- "--log.level=INFO"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik:/etc/traefik:ro
- ./logs/traefik:/var/log/traefik
networks:
- crowdsec-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.service=api@internal"
networks:
crowdsec-network:
driver: bridge
volumes:
crowdsec-db:
crowdsec-config: