Run migrations before starting dev server
Chains 'migrate --noinput' before 'runserver' in the web service command so migrations are applied automatically on 'docker compose up'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,9 @@ services:
|
||||
web:
|
||||
build: .
|
||||
working_dir: /app
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
command: >
|
||||
sh -c "python manage.py migrate --noinput &&
|
||||
python manage.py runserver 0.0.0.0:8000"
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user