docker compose command multiple lines code example

Example 1: docker-compose command multiple

command: >
    bash -c "python manage.py migrate
    && python manage.py runserver 0.0.0.0:8000"

Example 2: docker-compose command multiple

command: |
      sh -c "python manage.py wait_for_db &&
             python manage.py migrate &&
             python manage.py runserver 0.0.0.0:8000"

Example 3: docker-compose command multiple

command: bash -c "
    python manage.py migrate
    && python manage.py runserver 0.0.0.0:8000
  "

Example 4: docker-compose command multiple

command: >
      sh -c "python manage.py wait_for_db &&
             python manage.py migrate &&
             python manage.py runserver 0.0.0.0:8000"