version: '3.1'

services:
  bor:                      
    build:                                
      args:                
        UPSTREAM_VERSION: v0.2.14
      context: ./polygon/bor                       
      dockerfile: Dockerfile                                                                                                                                                                                
    environment:                                   
      - SNAPSHOT_URL=https://matic-blockchain-snapshots.s3-accelerate.amazonaws.com/matic-mainnet/bor-archive-node-snapshot-2022-03-17.tar.gz
      - BOOTSTRAP=1
      - ARCHIVE=1
    volumes:                  
      - "bor-archive_data:/datadir"
    ports:                   
      - "40303:40303"                                                                                 
      - "40303:40303/udp"                
    depends_on:                                                                                       
      - heimdallr                                                                                     
    restart: unless-stopped                 
    labels:                     
      - "traefik.enable=true"
      - "traefik.http.middlewares.bor-stripprefix.stripprefix.prefixes=/polygon-archive"                      
      - "traefik.http.services.bor.loadbalancer.server.port=8545"                                     
      - "traefik.http.routers.bor.entrypoints=websecure"                                              
      - "traefik.http.routers.bor.tls.certresolver=myresolver"                                        
      - "traefik.http.routers.bor.rule=Host(`$DOMAIN`) && PathPrefix(`/polygon-archive`)"                     
      - "traefik.http.routers.bor.middlewares=bor-stripprefix, ipwhitelist"                           
    networks:                                                                                         
      - chains

volumes:  
    bor-archive_data:
