version: '3.7'

volumes:
  wekan:

networks:
  proxy:
    external: true
  wekan:
    name: wekan

services:
  wekan-db:
    image: mongo:4.2
    container_name: wekan-db
    command: mongod --oplogSize 128
    expose:
      - 27017
    volumes:
      - wekan:/data/db
    networks:
      - wekan
    restart: unless-stopped

  wekan-app:
    image: wekanteam/wekan:v4.25
    container_name: wekan-app
    environment:
      - MONGO_URL=mongodb://wekan-db:27017/wekan
      - ROOT_URL=https://kanban.picasoft.net
      # ==== WEKAN API AND EXPORT BOARD ====
      # Wekan Export Board works when WITH_API=true.
      # https://github.com/wekan/wekan/wiki/REST-API
      - WITH_API=true
      # ==== PASSWORD BRUTE FORCE PROTECTION ====
      - ACCOUNTS_LOCKOUT_KNOWN_USERS_FAILURES_BEFORE=10
      - ACCOUNTS_LOCKOUT_KNOWN_USERS_PERIOD=60
      - ACCOUNTS_LOCKOUT_KNOWN_USERS_FAILURE_WINDOW=15
    env_file: ./secrets/mail.secrets
    depends_on:
      - wekan-db
    labels:
      traefik.http.routers.wekan-app.entrypoints: websecure
      traefik.http.routers.wekan-app.rule: Host(`kanban.picasoft.net`)
      traefik.http.services.wekan-app.loadbalancer.server.port: 8080
      traefik.enable: true
    networks:
      - proxy
      - wekan
    restart: unless-stopped

  wekan-filter-hooks:
    image: registry.picasoft.net/wekan-filter-hooks:v0.2
    build: ./filter-hooks
    container_name: wekan-filter-hooks
    networks:
      - wekan
    restart: unless-stopped
