Skip to content

Commit

Permalink
Merge pull request #335 from ministryofjustice/migration-not-in-startup
Browse files Browse the repository at this point in the history
Migration not run on startup
  • Loading branch information
David Read authored Sep 24, 2018
2 parents 613b24a + 47826da commit eb0f269
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ services:
environment:
POSTGRES_USER: "controlpanel"
POSTGRES_DB: "controlpanel"
migration:
image: app:latest
command: ["sh", "-c", "python3 wait_for_db && python3 manage.py migrate"]
environment:
DB_HOST: "db"
DB_NAME: "controlpanel"
DB_USER: "controlpanel"
links:
- db
depends_on:
- db
1 change: 0 additions & 1 deletion run_api
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
set -e -o pipefail

python3 wait_for_db && \
python3 manage.py migrate && \
gunicorn -b 0.0.0.0:8000 control_panel_api.wsgi:application

0 comments on commit eb0f269

Please sign in to comment.