From 68c720f51295afb5f06b6309d78fe7b57087938c Mon Sep 17 00:00:00 2001 From: Mark Janssen <20283+praseodym@users.noreply.github.com> Date: Tue, 6 Jun 2023 09:04:14 +0200 Subject: [PATCH] Remove containers after `docker-compose run` Prevents e.g. `katalogus-run-...` containers from piling up in development environments. --- boefjes/Makefile | 6 +++--- bytes/Makefile | 2 +- mula/Makefile | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/boefjes/Makefile b/boefjes/Makefile index 2f74805752a..cc876c0b98d 100644 --- a/boefjes/Makefile +++ b/boefjes/Makefile @@ -31,7 +31,7 @@ help: ## Show this help. build: seed seed: # Seed the katalogus database - -docker-compose run katalogus python -m boefjes.seed + -docker-compose run --rm katalogus python -m boefjes.seed ## ##|------------------------------------------------------------------------| @@ -42,12 +42,12 @@ migrations: ## Generate a migration using alembic ifeq ($(m),) $(HIDE) (echo "Specify a message with m={message} and a rev-id with revid={revid} (e.g. 0001 etc.)"; exit 1) else - docker-compose run katalogus python -m alembic --config /app/boefjes/boefjes/alembic.ini revision --autogenerate -m "$(m)" + docker-compose run --rm katalogus python -m alembic --config /app/boefjes/boefjes/alembic.ini revision --autogenerate -m "$(m)" endif sql: ## Generate raw sql for the migrations - docker-compose run katalogus python -m alembic --config /app/boefjes/boefjes/alembic.ini upgrade $(rev1):$(rev2) --sql + docker-compose run --rm katalogus python -m alembic --config /app/boefjes/boefjes/alembic.ini upgrade $(rev1):$(rev2) --sql check: pre-commit run --all-files --color always diff --git a/bytes/Makefile b/bytes/Makefile index 7a83e273d5f..709fa39127a 100644 --- a/bytes/Makefile +++ b/bytes/Makefile @@ -34,7 +34,7 @@ done: lint test ## Prepare for a commit. lint: ## Format the code using black. pre-commit run --all-files --show-diff-on-failure --color always -py-run := docker-compose run bytes python +py-run := docker-compose --rm run bytes python export revid diff --git a/mula/Makefile b/mula/Makefile index 57493e00ebb..bcf8c2d2d66 100644 --- a/mula/Makefile +++ b/mula/Makefile @@ -83,7 +83,7 @@ ifeq ($(m),) else ifeq ($(revid),) $(HIDE) (echo "ERROR: Specify a message with m={message} and a rev-id with revid={revid} (e.g. 0001 etc.)"; exit 1) else - docker-compose run scheduler \ + docker-compose run --rm scheduler \ alembic --config /app/scheduler/scheduler/alembic.ini \ revision --autogenerate \ -m "$(m)" --rev-id "$(revid)"