Cấu trúc YAML Docker Compose
Compose dùng YAML (v2.x/v3.x) định nghĩa ứng dụng đa container ở dạng khai báo. Tệp gồm: version (tương thích), services (image, ports, volumes, env, networks), volumes, networks, configs/secrets. Mỗi service khai báo image, build, ánh xạ port (host:container), volumes (bind, named, tmpfs), biến môi trường, depends_on, restart, giới hạn tài nguyên, healthcheck. Công cụ chuyển flag docker chạy sang cấu trúc Compose tương ứng.