services:
tailscale:
image: tailscale/tailscale:latest
container_name: tailscale-crowdsec
hostname: crowdsec-manager-ts # The name that will appear in your Tailscale admin panel
environment:
- TS_AUTHKEY=
- TS_STATE_DIR=/var/lib/tailscale
volumes:
- tailscale-data:/var/lib/tailscale
- /dev/net/tun:/dev/net/tun
cap_add:
- net_admin
- sys_module
ports:
- "8080:8080"
networks:
pangolin:
aliases:
- crowdsec-manager # Ensures other containers on the network can still reach it by its original name!
restart: unless-stopped
crowdsec-manager:
image: hhftechnology/crowdsec-manager:independent
container_name: crowdsec-manager-independent
network_mode: service:tailscale # This is the magic: it merges networking with the Tailscale container
depends_on:
- tailscale
restart: unless-stopped
# 'expose' and 'networks' are removed here because Tailscale manages the network connection now
environment:
- PORT=8080
- ENVIRONMENT=production
- CONFIG_DIR=/app/config
- DATABASE_PATH=/app/data/settings.db
- INCLUDE_CROWDSEC=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./config:/app/config
- ./logs/app:/app/logs
- ./data:/app/data
networks:
pangolin:
external: true
volumes:
tailscale-data: