Member-only story

Understanding the Visual Studio Docker-Compose integration

Stefan Schranz
7 min readApr 19, 2023

After explaining the Visual Studio FastMode for Docker containers in my last post , I want to continue with the next logical step today, as in, going through the capabilities and inner workings of the Docker-Compose integration of Visual Studio.

In case you are not familiar with it — Within Visual Studio, you are able to right click on an executable project, e.g. an Asp.Net Core or a console application project, and then Add -> Container Orchestrator Support -> Docker-Compose.

This will set you up with a docker-compose project, just like this:

If you inspect the docker-compose.yml, you will see that your project is now embedded within a docker-compose.yml.

You can now go ahead and set the docker-compose project as a startup project, and once you start it, VS will automatically start all services in your compose file for you, and depending on configuration, immediately attach a debugger as well — Just like with the regular fastmode.

By itself this is not particularly useful (yet), since at this point you gain nothing on top of the regular fast mode. However, the first part which makes the whole setup very convenient is that you can add various other services to your compose setup. Let’s assume your API requires a redis connection with a…

--

--

Stefan Schranz
Stefan Schranz

Written by Stefan Schranz

26 year old full stack software developer from Germany - Enthusiatic about C#, .Net and Cloud — Visit me at https://dotschranz.net/

No responses yet