Does docker create multiple or a single container for this yaml file?

I have this docker-compose file that runs SQL Server, .NET API and Angular App. What I want to understand is that does this create three different containers? Each service running inside their own container? Or all three services get created within same container and it’s only the network that is shared?
If they reside in their individual containers, I am guessing it should be possible to shut down one while keeping others running.

version: "3"
services:
    coreapi:
        build:
            context: ./theapi
            dockerfile: Dockerfile
        ports:
            - "5000:5000"
    sqlserver:
        build:
            context: ./sqlserver
        ports:
            - "11433:1433"    
        environment: 
            - ACCEPT_EULA="Y"
            - SA_PASSWORD="Pwd12345!"
    angular:
        build:
            context: ./frontend
            dockerfile: Dockerfile
        ports:
            - "4300:4200"

Hi

Yes, all services in this yaml file will run in multiple containers, and yes, you can stop/start them individually if you want :slight_smile:

1 Like