statically building opencv to avoid any external dependency on production system to run generated binary file
sudo docker compose build
sudo docker compose up
After running docker container, you can coonect it via bash from other terminal window.
sudo docker compose exec opencv bash
cd /workspace/opencv-dnn-demo/build/
cmake .. && make -j $nproc
./main