none
How to start several containers via Docker Compose in Visual Studio? RRS feed

  • Question

  • I have two micro-service projects: WebApi (C#, netcore, webapi) and Frontend (php+js). Frontend uses Redis. So i want to start 3 Docker containers (WebApi, Frontend, Redis) simultaneously while debugging WebApi in Visual Studio. Is it possible?

    I added Docker and Docker orchestration support. Dockerfile and docker-compose.yml files are appeared. I configured docker-compose:

    version: '3.7'
    
    networks:
      esnet:
    
    services:
      eswebapi:
        image: swebapi
        build:
          context: ./ESWebAPI
        networks:
        - esnet
        expose:
        - 80
        ports:
        - "8080:80"    
      esweb:
        image: esweb
        build:
          context: ../../app
        networks:
        - esnet
        expose:
        - 80
        ports:
        - "80:80"      
      esredis:
        image: redis:3.2.12
        expose:
        - 6379
        networks:
        - esnet

    I start debug in Visual Studio, but it starts only WebApi project container. Frontend and Redis aren't started at all. How to start all 3 containers?

    I use Visual Studio 2017 Community Edition

    Thursday, March 14, 2019 12:26 PM

All replies

  • Hi Lans,

    Thank you for posting here.

    This forum is about using visual studio (designer ,reported controls, editor and etc in vs ide). For your case  which is more related to asp.net core, please redirect this appropriate forum: ASP.NET CORE forum for better support.

    Thank you for your understanding.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Friday, March 15, 2019 7:59 AM