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

  • Thread starter Thread starter Dmitry Lans
  • Start date Start date
D

Dmitry Lans

Guest
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

Continue reading...
 
Back
Top