
Docker Compose
docker-compose.yml file, services, depends_on, healthchecks, shared volumes, networks, environment variables, profiles
1What is the main role of a docker-compose.yml file?
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.
2Which command starts all services defined in docker-compose.yml in the background?
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.
3How to define a named volume shared between multiple services in docker-compose.yml?
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.
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?
+17 interview questions
Other Data Engineering interview topics
Linux & Shell - Fundamentals
Git & GitHub - Fundamentals
Advanced Python for Data Engineering
Docker - Fundamentals
Google Cloud Platform - Fundamentals
CI/CD and Code Quality
FastAPI - Data APIs
Advanced SQL for Data Engineering
Data Lake - Architecture and Ingestion
BigQuery for Data Engineering
PostgreSQL - Administration
Data Modeling for Data Engineering
Fivetran & Airbyte - Data Ingestion
dbt - Fundamentals
Apache Airflow - Fundamentals
Kubernetes - Fundamentals
dbt - Advanced Features
ETL / ELT / ETLT Patterns
Apache Airflow - Advanced
Airflow + dbt - Pipeline Orchestration
PySpark - Large-Scale Processing
Google Pub/Sub - Data Streaming
Apache Beam & Dataflow
Kubernetes - Production and Scaling
Terraform - Infrastructure as Code
NoSQL Databases
Modern Data Architecture
Monitoring and Observability
IAM and Data Security
Master Data Engineering for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free