Docker Run multiple containers on same network from visual studio 2017

Hi,

I hope this is the right place to ask this question, if not please forgive me and point me where it needs to go.

Ok, my problem. I have 2 projects created in visual studio that run in their own containers. How can i configure the docker.compose.yml to start both. They both need to be on the same network as they need to talk to each other,

I have my compose file below. Image ‘ticketgatewayapi’ starts ok ,but ‘ticketmicroserviceapi:dev’ exits straight away. I think it can find it, but i dont know how to define this in the compose file.

Any help would be appreciated

docker-compose file:

`version: '3'

services:
ticketgatewayapi:
image: ticketgatewayapi
build:
context: .
dockerfile: TicketGateway/TicketGatewayApi/Dockerfile
environment:
TicketMsUrl: http://ticket_microservice/
TicketMicroserviceVersion: v1.0
ExceptionlessAPIKey: J0uThf6RGN30lEKMSHnrKocklqw79uGe6vNAlKmN
ports:
- ‘8085:80’
networks:
- poc_network
ticket_ms:
image: ‘ticketmicroserviceapi:dev’
build:
context: .
dockerfile: …/…/…/…/…/…/…/source/repos/TicketMicroService/TicketMicroService/TemplateApi/Dockerfile
container_name: ticketms
environment:
ExceptionlessAPIKey: WieKo0dqJjvolCcYgsGInyuj5d48PeOcykYWAhgc
TicketMicroserviceConnectionString: Server=sql;Database=ImagineTickets;Trusted_Connection=False;User ID=sa;Password=Dave_123456;MultipleActiveResultSets=true;
ports:
- ‘8099:80’
networks:
- poc_network

networks:
poc_network:
driver: bridge
`

1 Like