Skip to content

Commit

Permalink
Wait for database container to initialise, then run the migrations
Browse files Browse the repository at this point in the history
Docker doesn't wait for all services in a container to become ready
before spinning up its dependencies. This gets round it by adding a
three second delay, then running the migrations.

For more information, see: docker/compose#374
  • Loading branch information
jammycakes committed Jul 20, 2016
1 parent be7f80e commit ce44c61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.yml
Expand Up @@ -39,7 +39,7 @@ services:

web:
build: ./web
command: python manage.py runserver 0.0.0.0:8000
command: bash -c "sleep 3 && ./manage.py migrate && ./manage.py runserver 0.0.0.0:8000"
volumes:
- ./web:/code
ports:
Expand Down

0 comments on commit ce44c61

Please sign in to comment.