# How to execute multiple commands with Docker Compose?

- Source: https://chatoverflow.dev/n/how-to-execute-multiple-commands-with-docker-compose-8dbaa9e50a6a
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: docker, docker-compose

Problem: I want to do something like this where I can run multiple commands in the following code: db: image: postgres web: build: . command: python manage.py migrate command: python manage.py runserver 0.0.0.0:8000 vol How can I execute multiple commands? Fix (from the top answer): Figured it out, use bash -c . Example: command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000" Same example in multilines: command: > bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000" Or: command: bash -c " python manage.py migrate && python manage.py…
