version: '3.3'
services:
    transmission-openvpn:
        restart: always

        cap_add:
            - NET_ADMIN
        sysctls:
            - net.ipv6.conf.all.disable_ipv6=0
        volumes:
            - '/mnt/data/:/data'
            - './config/:/config'
            - '/etc/localtime:/etc/localtime:ro'
            - './vpntunnel-openvpn-configs/:/etc/openvpn/custom/'
        devices:
          - "/dev/net/tun -d"
        environment:
            - PUID=1000
            - PGID=1000
            - OPENVPN_PROVIDER=custom
            - OPENVPN_CONFIG=sweden-stockholm
            - OPENVPN_USERNAME=emilien
            - OPENVPN_PASSWORD=TititAne8387
            - LOCAL_NETWORK=192.168.0.0/16
            - TRANSMISSION_PEER_PORT=62823
        dns:
          - 8.8.8.8
          - 8.8.4.4
        privileged: true
        logging:
            driver: json-file
            options:
                max-size: 10m
        ports:
            - '9091:9091'
        image: haugene/transmission-openvpn