Using Docker-Compose, how to execute multiple commands
Asked 07 September, 2021
Viewed 2.6K times
  • 55
Votes

I want to do something like this where I can run multiple commands in order.

db:
  image: postgres
web:
  build: .
  command: python manage.py migrate
  command: python manage.py runserver 0.0.0.0:8000
  volumes:
    - .:/code
  ports:
    - "8000:8000"
  links:
    - db

16 Answer