services:
    traefik:
        command: traefik
        container_name: traefik
        environment:
            CF_API_EMAIL: alexanderlebens@gmail.com
            CF_API_KEY: f83de272d8c6f76a6d9074160780c924c0878
            PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        image: docker.io/traefik:2.9.6
        labels:
            traefik.docker.network: traefik
            traefik.enable: true
            traefik.http.routers.dashboard.entrypoints: websecure
            traefik.http.routers.dashboard.rule: (Host(`traefik.alexlebens.net`) && (PathPrefix(`/api/`) || PathPrefix(`/dashboard/`)))
            traefik.http.routers.dashboard.service: api@internal
            traefik.http.routers.dashboard.tls: true
            traefik.http.routers.dashboard.tls.certresolver: le-cloudflare
        logging:
            driver: json-file
            options:
                max-size: 50m
                max-file: "3"
        networks:
            traefik: null
        ports:
            - 192.168.1.15:80:80
            - 192.168.1.15:443:443
            - 192.168.1.15:9000:9000
        privileged: true
        restart: always
        user: root
        volumes:
            - config:/etc/traefik
            - log:/log
            - /var/run/docker.sock:/var/run/docker.sock:ro

networks:
    traefik:
        name: traefik
        external: true

volumes:
    config:
        driver: local
        driver_opts:
            type: none
            o: bind
            device: /var/lib/docker/volumes/partition/traefik_config

    log:
        driver: local
        driver_opts:
            type: none
            o: bind
            device: /var/lib/docker/volumes/partition/traefik_log