version: '2.3'

services:
  fail2ban:
    build: ./fail2ban
    hostname: fail2ban
    container_name: fail2ban
    restart: always
    entrypoint:
      - /bin/bash
      - /etc/fail2ban/entrypoint.sh
    volumes:
      - ./fail2ban/entrypoint.sh:/etc/fail2ban/entrypoint.sh:ro
      - ./fail2ban/sshd_config:/etc/ssh/sshd_config:ro
      - ./fail2ban.log:/var/log/fail2ban.log
    cap_add:
      - NET_ADMIN
      - NET_RAW
    ports:
      - "22:22/tcp"
      - "2222:2222/tcp"
    networks:
      mynet:
        ipv4_address: 172.13.0.101
        ipv6_address: 2001:db8:3::101

networks:
  mynet:
    enable_ipv6: true
    driver: bridge
    ipam:
      config:
      - subnet: 172.13.0.0/24
      - subnet: 2001:db8:3::/64
