# Docker Compose (Data Engineering) > docker-compose.yml file, services, depends_on, healthchecks, shared volumes, networks, environment variables, profiles - 20 interview questions - Mid-Level - [Interview Questions: Data Engineering](https://sharpskill.dev/en/technologies/data-engineering/interview-questions.md) ## 1. What is the main role of a docker-compose.yml file? **Answer** The docker-compose.yml file allows defining and running multi-container Docker applications. It describes services, their images, volumes, networks, and dependencies in a declarative YAML format. This simplifies starting complex environments with a single docker compose up command. ## 2. Which command starts all services defined in docker-compose.yml in the background? **Answer** The docker compose up -d command starts all services in detached (daemon) mode. The -d flag allows containers to run in the background, freeing the terminal. Without this flag, logs from all services display in the terminal and stopping the process stops the containers. ## 3. How to define a named volume shared between multiple services in docker-compose.yml? **Answer** Named volumes are declared in a volumes: section at the root level of the file, then referenced in each service. Unlike bind mounts, named volumes are managed by Docker and persist independently of containers. They allow reliable data sharing between services. ## 17 more questions available - What is the difference between depends_on and healthcheck in Docker Compose? - How to configure a healthcheck for a PostgreSQL service in docker-compose.yml? Sign up for free: https://sharpskill.dev/en/login ## Other Data Engineering interview topics - [Linux & Shell - Fundamentals](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/linux-shell-basics.md): 20 questions, Junior - [Git & GitHub - Fundamentals](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/git-github-fundamentals.md): 20 questions, Junior - [Advanced Python for Data Engineering](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/python-advanced-de.md): 25 questions, Junior - [Docker - Fundamentals](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/docker-fundamentals.md): 25 questions, Junior - [Google Cloud Platform - Fundamentals](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/gcp-fundamentals.md): 20 questions, Junior - [CI/CD and Code Quality](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/ci-cd-code-quality.md): 20 questions, Mid-Level - [FastAPI - Data APIs](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/fastapi.md): 20 questions, Mid-Level - [Advanced SQL for Data Engineering](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/sql-advanced-de.md): 20 questions, Mid-Level - [Data Lake - Architecture and Ingestion](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/data-lake.md): 20 questions, Mid-Level - [BigQuery for Data Engineering](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/bigquery-de.md): 20 questions, Mid-Level - [PostgreSQL - Administration](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/postgresql-admin.md): 20 questions, Mid-Level - [Data Modeling for Data Engineering](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/data-modeling-de.md): 20 questions, Mid-Level - [Fivetran & Airbyte - Data Ingestion](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/fivetran-airbyte.md): 20 questions, Mid-Level - [dbt - Fundamentals](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/dbt-fundamentals-de.md): 20 questions, Mid-Level - [Apache Airflow - Fundamentals](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/airflow-fundamentals.md): 20 questions, Mid-Level - [Kubernetes - Fundamentals](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/kubernetes-fundamentals.md): 20 questions, Mid-Level - [dbt - Advanced Features](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/dbt-advanced-de.md): 20 questions, Senior - [ETL / ELT / ETLT Patterns](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/etl-elt-patterns.md): 20 questions, Senior - [Apache Airflow - Advanced](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/airflow-advanced.md): 20 questions, Senior - [Airflow + dbt - Pipeline Orchestration](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/airflow-dbt-integration.md): 20 questions, Senior - [PySpark - Large-Scale Processing](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/pyspark.md): 20 questions, Senior - [Google Pub/Sub - Data Streaming](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/pubsub-streaming.md): 20 questions, Senior - [Apache Beam & Dataflow](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/apache-beam-dataflow.md): 20 questions, Senior - [Kubernetes - Production and Scaling](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/kubernetes-advanced.md): 20 questions, Senior - [Terraform - Infrastructure as Code](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/terraform.md): 20 questions, Senior - [NoSQL Databases](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/nosql-databases.md): 20 questions, Senior - [Modern Data Architecture](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/data-architecture.md): 20 questions, Senior - [Monitoring and Observability](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/monitoring-observability.md): 20 questions, Senior - [IAM and Data Security](https://sharpskill.dev/en/technologies/data-engineering/interview-questions/iam-security-de.md): 20 questions, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/en/technologies/data-engineering/interview-questions/docker-compose