Common practice is separate Dockerfiles for deployments and development systems.
You can define a docker file without default when building:
docker build -f Dockerfile.dev -t devimage .
One image can use the compiled version of the source, and another image can mount the / src folder in the system for live updates.
source share