انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-050-L01

ملفات Compose

  • الدرس 1 من 5
  • Junior
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

describe a multi-service environment in one file.

الموضوعات المخطط لها

  • Compose runs several containers together from compose.yaml; one command starts or stops them all.
  • Each entry under services: is a container: image or build, ports, environment, volumes.
  • Compose creates a network for the project; services reach each other by service name.
  • Named volumes go under volumes:.
  • Commands: docker compose up -d, ps, logs -f, down (add -v to delete volumes).
تفاصيل المخطط المبدئي

عرض عملي

yaml
services:
  db:
    image: postgres:16
    environment:
      POSTGRES_PASSWORD: dev
    volumes: [pgdata:/var/lib/postgresql/data]
  app:
    build: .
    ports: ["8080:8080"]
volumes:
  pgdata:

اختبر فهمك

What does docker compose down -v do beyond down?

أظهر الإجابة

It also deletes the named volumes and their data.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.