I'm wondering how people go about using docker for both production and development. In development I want to mount my source/build files to be able to quickly and easily make changes. For production, I want to include the source/build files in the image.
How is this typically done and is there a best or more common practice?
In my mind, ideally I would have one Dockerfile that uses something like a flag or environment variable to setup a prod or dev image, but I can't find any examples of people doing this and I am not sure how exactly it would be done.
I've also seen a few rough examples of projects with unique Dockerfiles for production and development, but then there is the issue of maintaining separate Dockerfiles which could diverge over time if we aren't careful.
Are both of these sensible or am I possibly misunderstanding something? I'm relatively new to docker. An example Dockerfile or project utilizing a similar setup would be great. I wary of dockerizing some of our services with bad practices at the start.
Edit: All my current apps are python base if that affects any responses.