Debugging with Docker Compose in Visual Studio 2017

You'll need to select Show all files at the solution level to see all the Docker Compose files generated by Visual Studio 2017. There's a basic docker-compose.yml with the web application defined as a service, complete with build details for the Dockerfile:

services:  webapi.netfx:    image: webapi.netfx    build:      context: .\WebApi.NetFx      dockerfile: Dockerfile

There's also a docker-compose.vs.debug.yml, which makes use of Docker volumes to provide the Visual Studio debugger experience:

services:  webapi.netfx:  image: webapi.netfx:dev  build:    args:      source: ${DOCKER_BUILD_SOURCE}  volumes:    - .\WebApi.NetFx:C:\inetpub\wwwroot    - ~\msvsmon:C:\msvsmon:ro  labels: - "com.microsoft.visualstudio.targetoperatingsystem=windows" ...

Get Docker on Windows now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.