Background:
When working with Python-based containers, I usually create employ docker-compose to create a dev.yml override that ensures auto-reloading of Python files and provides the Python source using a volume (instead of adding the files). This way I can get really quick turnaround times when developing (basically just saving the file). Now I need to create a few services in ASP.net core and I am looking to do the same.
TL;DR:
Here's the essentials of my Dockerfile:
FROM microsoft/dotnet
ADD src /app
RUN cd /app/src ; \
dotnet build
ADD env/appsettings.json /app/src/TestService
CMD cd /app/src/TestService ; \
dotnet run
Now, the question is: How can I fit this into an efficient development workflow. Of course I know I can just run Kestrel from Visual Studio, this is not my question. I need to run the container itself (it requires its Compose context as it has other service dependencies). I am not too bothered with stepping in Visual Studio etc (I know VS is supposed to have Docker support, but I haven't been too impressed so far), but I need something slightly more efficient than rebuilding the container every time I make a code change.
I think I want this:
But I am also open to suggestions, especially if there is a canonical way of working with ASP.net core in Docker that I have failed to find.