services:
  flodpodmaster:
    image: git.send.nrw/sendnrw/flod-pod:latest
    container_name: flodpodmaster
    labels:
      - traefik.enable=true
      - traefik.http.routers.flodpodmaster.rule=Host(`flod-proxy.send.nrw`)
      - traefik.http.services.flodpodmaster.loadbalancer.server.port=8080
      - traefik.http.routers.flodpodmaster.entrypoints=websecure
      - traefik.http.routers.flodpodmaster.tls=true
      - traefik.http.routers.flodpodmaster.tls.certresolver=letsencrypt
      - traefik.http.middlewares.flodpodmaster0-redirect.redirectscheme.scheme=https
      - traefik.http.middlewares.flodpodmaster0-redirect.redirectscheme.permanent=true
      - traefik.http.routers.flodpodmaster0.rule=Host(`flod-proxy.send.nrw`)
      - traefik.http.routers.flodpodmaster0.entrypoints=web
      - traefik.http.routers.flodpodmaster0.middlewares=flodpodmaster0-redirect
      - traefik.protocol=http
    depends_on:
      - flodredis
    networks:
      - traefik-net
    environment:
      # Beispiel – mehrere Listen in einer Kategorie „spam“
      BLOCKLIST_MODE: master
      REDIS_ADDR: flodredis:6379
      HASH_NAME: bl:flodpod
      MASTER_URL: https://flod-proxy.send.nrw
      #ports:
      #- "8080:8080"   # <host>:<container>
    restart: unless-stopped
  flodmaster:
    image: git.send.nrw/sendnrw/flod:latest
    container_name: flodmaster
    labels:
      - traefik.enable=true
      - traefik.http.routers.flodmaster.rule=Host(`flod.send.nrw`)
      - traefik.http.services.flodmaster.loadbalancer.server.port=8080
      - traefik.http.routers.flodmaster.entrypoints=websecure
      - traefik.http.routers.flodmaster.tls=true
      - traefik.http.routers.flodmaster.tls.certresolver=letsencrypt
      - traefik.http.middlewares.flodmaster0-redirect.redirectscheme.scheme=https
      - traefik.http.middlewares.flodmaster0-redirect.redirectscheme.permanent=true
      - traefik.http.routers.flodmaster0.rule=Host(`flod.send.nrw`)
      - traefik.http.routers.flodmaster0.entrypoints=web
      - traefik.http.routers.flodmaster0.middlewares=flodmaster0-redirect
      - traefik.protocol=http
    networks:
      - traefik-net
    depends_on:
      - flodredis
      - flodimporter
    environment:
      # Redis-Adresse schon per Docker-Netzwerk korrekt:
      REDIS_ADDR: flodredis:6379
      ROLE: worker
      TTL_HOURS: "720"
      FLOD_IMPORT_URL: http://flodimporter:8080
      #ports:
      #- "8080:8080"   # <host>:<container>
    restart: unless-stopped
  flodimporter:
    image: git.send.nrw/sendnrw/flod-ipv64-parser:latest
    container_name: flodimporter
    depends_on:
      - flodredis
    labels:
      - traefik.enable=true
      - traefik.http.routers.flodimporter.rule=Host(`flod-import.send.nrw`)
      - traefik.http.services.flodimporter.loadbalancer.server.port=8080
      - traefik.http.routers.flodimporter.entrypoints=websecure
      - traefik.http.routers.flodimporter.tls=true
      - traefik.http.routers.flodimporter.tls.certresolver=letsencrypt
      - traefik.http.middlewares.flodimporter0-redirect.redirectscheme.scheme=https
      - traefik.http.middlewares.flodimporter0-redirect.redirectscheme.permanent=true
      - traefik.http.routers.flodimporter0.rule=Host(`flod-import.send.nrw`)
      - traefik.http.routers.flodimporter0.entrypoints=web
      - traefik.http.routers.flodimporter0.middlewares=flodimporter0-redirect
      - traefik.protocol=http
    environment:
      SERVEONLY: "1"
      DELAY: ""
      OUTDIR: ""
      LIST: ""
      LISTEN: :8080
      PREFIX: http://flodimporter:8080
    networks:
      - traefik-net
    restart: unless-stopped
    volumes:
      - importer-lists:/lists
  flodredis:
    image: redis:7-alpine
    container_name: flodredis
    ports:
      - 6379:6379
    networks:
      - traefik-net
    command:
      - redis-server
      - /usr/local/etc/redis/redis.conf
    volumes:
      - redis-data:/data # falls du doch Persistence willst
      - /docker/flod_redis/redis.conf:/usr/local/etc/redis/redis.conf:ro
    restart: unless-stopped
networks:
  traefik-net:
    external: true
volumes:
  redis-data: null
  importer-lists: null