diff --git a/docker-compose.yml b/docker-compose.yml index 6c4e81abe..8fa98d785 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/run_api b/run_api index bdf65c60c..16b898269 100755 --- a/run_api +++ b/run_api @@ -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