From df2e34e61c554b0802d22969921c25f8dfe87f16 Mon Sep 17 00:00:00 2001 From: jon r Date: Thu, 10 Oct 2024 11:15:05 +0200 Subject: [PATCH] fix(compose): move migrations into api container next to collectstatic The overall process runs faster than in a separate container, which reduces recreation times while developing. --- compose.yml | 8 +------- compose/app.django.yml | 19 ++++++------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/compose.yml b/compose.yml index 122cd45c2..5b0e065d0 100644 --- a/compose.yml +++ b/compose.yml @@ -40,7 +40,7 @@ x-django: &django services: front: build: - context: ../front + context: ./front dockerfile: Dockerfile.dev ports: - "${VUE_PORT:-8080}:${VUE_PORT:-8080}" @@ -67,12 +67,6 @@ services: service: celeryworker <<: *django - migrate: - extends: - file: ./compose/app.django.yml - service: migrate - <<: *django - nginx: extends: file: ./compose/app.nginx.yml diff --git a/compose/app.django.yml b/compose/app.django.yml index 8dc1971aa..f26ea0a69 100644 --- a/compose/app.django.yml +++ b/compose/app.django.yml @@ -2,7 +2,7 @@ x-django: &django image: funkwhale-api volumes: - ../api:/app - - "${MUSIC_DIRECTORY_SERVE_PATH-../.state/music}:/music:ro" + - "${MUSIC_DIRECTORY_SERVE_PATH:-../.state/music}:/music:ro" - "../.state/plugins:/srv/funkwhale/plugins" - "../.state/staticfiles:/staticfiles" - "../.state/media:/protected/media" @@ -23,20 +23,13 @@ services: dockerfile: Dockerfile args: install_dev_deps: 1 - depends_on: - migrate: - condition: service_completed_successfully command: > - bash -c "funkwhale-manage collectstatic --no-input - && uvicorn --reload config.asgi:application --host 0.0.0.0 --port 5000 --reload-dir config/ --reload-dir=funkwhale_api/" + bash -c " + funkwhale-manage migrate && + funkwhale-manage collectstatic --no-input && + uvicorn --reload config.asgi:application --host 0.0.0.0 --port 5000 --reload-dir config/ --reload-dir funkwhale_api/ + " celeryworker: <<: *django - depends_on: - migrate: - condition: service_completed_successfully command: celery -A funkwhale_api.taskapp worker -l debug -B --concurrency=${CELERYD_CONCURRENCY} - - migrate: - <<: *django - command: funkwhale-manage migrate