version: '2'

services:
  wekandb:
    image: mongo:4.2
    container_name: wekan-db
    restart: always
    command: mongod --oplogSize 128
    networks:
      - wekan-tier
    expose:
      - 27017
    volumes:
      - ./wekan-db:/data/db
      - ./wekan-db-dump:/dump

  wekan:
    image: wekanteam/wekan:latest
    container_name: wekan-app
    restart: always
    networks:
      - wekan-tier
      - acme-companion_proxy-tier

    environment:
      - VIRTUAL_HOST=board.franv.site
      - LETSENCRYPT_HOST=board.franv.site
      - LETSENCRYPT_EMAIL=ouch@thetrauma.org
      - VIRTUAL_PORT=8080    
      - MONGO_URL=mongodb://wekandb:27017/wekan
      - ROOT_URL=https://board.franv.site  #   <=== using only at same laptop/desktop where Wekan is 
#      - MAIL_URL=45.142.176.100%3A1587/
      - MAIL_URL=smtp://sendemail:1587
      - MAIL_FROM=Wekan Notifications <noreply.board@franv.site>
      - WITH_API=true
      - RICHER_CARD_COMMENT_EDITOR=false
      - SCROLLINERTIA=0
      - SCROLLAMOUNT=auto
      - SCROLLDELTAFACTOR=auto
      - CARD_OPENED_WEBHOOK_ENABLED=false
      - BIGEVENTS_PATTERN=NONE
      - BROWSER_POLICY_ENABLED=true
      - LABEL=com.centurylinklabs.watchtower.enable=true
    labels:
      - diun.enable=true

    depends_on:
      - wekandb
      
  sendemail:
    image: boky/postfix:latest
    container_name: sendemail
    restart: always
    networks:
      - wekan-tier
    environment:
      - HOSTNAME=sendemail
      - RELAYHOST=smtp.gmail.com:587
      - RELAYHOST_USERNAME=franvvan@gmail.com
      - RELAYHOST_PASSWORD=mnzepnebvffsoxxw
      - ALLOWED_SENDER_DOMAINS=franv.site
#      - INBOUND_DEBUGGING=1
#      - VIRTUAL_PORT=587
#      - MYNETWORKS=allow domains from per Network ( default 127.0.0.0/8,10.0.0.0/8,172.28.0.0/16,192.168.96.0/20 )
      - MYNETWORKS=allow domains from per Network (0.0.0.0)
    ports:
      - '1587:587'

  mongodb-backup_wekan:
      image: drahoslavzan/mongodb-backup-s3:latest
      container_name: mongodb-backup_wekan
      depends_on:
        - wekandb      
      restart: always
      volumes:
        - ./dbbackup:/backup
      environment:
        - PUID=1002
        - PGID=1002      
        - CRON_SCHEDULE=0 1 * * *
        - BACKUP_FILE=mongodb
        - MONGO_URI=mongodb://wekandb:27017/wekan
        - AWS_ACCESS_KEY_ID=AKIAJER447UGIFJ2EADQ
        - AWS_SECRET_ACCESS_KEY=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
        - AWS_DEFAULT_REGION=us-west-2
        - AWS_BUCKET_DIR=s3://calodbbackup/wekan
      networks:
       wekan-tier:
   

volumes:
  wekan-db:
    driver: local
  wekan-db-dump:
    driver: local

networks:
  wekan-tier:
    driver: bridge
  acme-companion_proxy-tier:
     external: true    
    
      
      
      
      
      
      
      
     
      
