-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
139 lines (131 loc) · 3.75 KB
/
docker-compose.dev.yml
File metadata and controls
139 lines (131 loc) · 3.75 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
version: '3.8'
# Development docker-compose configuration
# Usage: docker-compose -f docker-compose.dev.yml up
services:
# CrowdSec Manager - Development mode with hot reload
crowdsec-manager-dev:
build:
context: .
dockerfile: Dockerfile.dev
container_name: crowdsec-manager-dev
restart: unless-stopped
ports:
- "8080:8080"
- "5173:5173" # Vite dev server
environment:
- PORT=8080
- ENVIRONMENT=development
- LOG_LEVEL=debug
- 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
- TRAEFIK_CONFIG_PATH=/app/config/traefik/dynamic_config.yml
- BACKUP_DIR=/app/backups
- RETENTION_DAYS=60
- INCLUDE_CROWDSEC=true
volumes:
# Docker socket
- /var/run/docker.sock:/var/run/docker.sock
# Source code for hot reload
- ./cmd:/app/cmd
- ./internal:/app/internal
- ./web:/app/web
# Configuration
- ./config:/app/config
- ./docker-compose.yml:/app/docker-compose.yml
# Backups
- ./backups:/app/backups
# Logs
- ./logs:/app/logs
# Go modules cache
- go-modules:/go/pkg/mod
networks:
- crowdsec-network
depends_on:
- crowdsec
- traefik
command: >
sh -c "
cd /app &&
go install github.com/cosmtrek/air@latest &&
cd /app/web && npm install && npm run dev &
cd /app && air -c configs/.air.toml
"
# 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/
- traefik-logs:/var/log/traefik:ro
networks:
- crowdsec-network
# Traefik Reverse Proxy
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
stop_grace_period: 60s
ports:
- "80:80"
- "443:443"
- "8081:8080"
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=DEBUG"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik:/etc/traefik:ro
- traefik-logs:/var/log/traefik
networks:
- crowdsec-network
labels:
- "traefik.enable=true"
networks:
crowdsec-network:
driver: bridge
volumes:
crowdsec-db:
crowdsec-config:
traefik-logs:
go-modules: