How to "docker-compose build" a service from code located in local git repository?
What you are specifically after (building from a bare repository on a local filesystem) isn't functionality offered by Docker, and by extension, docker-compose. Docker supports building from a few different URLs, but not bare repositories on local filesystems. You can try a few workarounds:


Build straight from Github: docker build https://github.com/docker/rootfs.git
Run a Git daemon to use the git:// protocol: git daemon --base-path=. --export-all (in /home/nou/code)
Running a Git daemon from within Docker, mounting your bare repository as a volume and building inside it via a mounted Docker socket
Converting your bare repository to a normal one


https://docs.docker.com/engine/reference/commandline/build/#build-with-url