How the use Docker exec to update code into a running container I am using docker-compose to manage Docker. Now suppose I want to update a source code in one of the Docker containers.

Can I do it using the exec but then how to copy the code from host to running container ?

Or is there any better solution to do the above task ?
It's a bad practice.
You need to use Continuous Integration rebuild docker image (see Dockerfile) every time when source code changed.