services:
    registry:
        container_name: docker_registry
        env_file:
            - .env
        image: registry:2
        logging:
            driver: json-file
            options:
                max-size: 50m
                max-file: "3"
        networks:
            traefik: null
        ports:
            - 5000:5000
        restart: always
        privileged: true
        user: root
        volumes:
            - registry:/var/lib/registry

networks:
    traefik:
        name: traefik
        external: true

volumes:
    registry:
        driver: local
        driver_opts:
            type: none
            o: bind
            device: /var/lib/docker/volumes/partition/docker_registry
