From 62298958bd6649f80f3a2d6d062d3804f390b4d0 Mon Sep 17 00:00:00 2001 From: lalanza808 Date: Fri, 3 Jan 2020 22:09:15 -0800 Subject: [PATCH] removing migrations from docker-compose and using make command, add db dependency --- Makefile | 3 +++ docker-compose.deploy.yaml | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index cb461c3..81b3215 100644 --- a/Makefile +++ b/Makefile @@ -32,3 +32,6 @@ deploy-logs: ## Show container logs deploy-static: ## Collect static docker run --rm --env-file=.env xmrauctions ./manage.py collectstatic --no-input + +deploy-migrations: ## Run migrations + docker run --rm --env-file=.env --net=xmrauctions_default xmrauctions ./manage.py migrate diff --git a/docker-compose.deploy.yaml b/docker-compose.deploy.yaml index ac4614e..789e2f3 100644 --- a/docker-compose.deploy.yaml +++ b/docker-compose.deploy.yaml @@ -7,13 +7,12 @@ services: command: [".venv/bin/gunicorn", "-b", "0.0.0.0:8000", "xmrauctions.wsgi"] ports: - 8000:8000 - migrations: - env_file: - - .env - image: xmrauctions:latest - command: ["./manage.py", "migrate"] + depends_on: + - "db" huey: env_file: - .env image: xmrauctions:latest command: ["./manage.py", "run_huey"] + depends_on: + - "db"