What are services in a docker-compose file?

The services section in a docker-compose file is an array of containers which are to be built and run together when the docker-compose file is executed. Each container under a docker-compose file is indicated with a user specific "service_name" which is used by other containers for communication among themselves. These "service names" need to be unique within a docker-compose file and are auto resolved for their respective containers by the docker.

version: '3'
        build: .
            - 8000:6379
        build: .
            - 8080:80

Docker Posted May 17, 2020

You can now show your support. 😊

We use cookies to provide you with a great user experience, analyze traffic and serve targeted promotions.   Learn More   Accept