InterviewSolution
| 1. |
What are docker-compose.yml files? |
|
Answer» Docker compose is a tool that helps to run multi-container docker applications. Compose uses docker-compose.yml which is a YAML file to configure application’s services. Compose workflow is a three-step process. First is to create a dockerfile to build the image, secondly define the services to be run on a container in the docker-compose.yml file and thirdly docker-compose up command starts up your entire applications. dockerfiles and docker-compose.yml files are similar but the MAIN difference is that docker compose file manages multi-container architecture rather than a single container. Sample docker-compose.yml file looks like: version: "7" services: testservice: # replace username/repo:tag with your name and image details image: <image name> deploy: replicas: 10 resources: limits: cpus: "0.2" MEMORY: 70M restart_policy: CONDITION: on-failure ports: - "9080:80" networks: - webnetThis docker-compose.yml is reflected upon below:
|
|