From 45e563b875df021ed48a638cfae5543290fb9583 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 13 Jan 2025 17:58:44 -0300 Subject: [PATCH 1/3] fix: mount frontend as a shared volume --- README.md | 1 - compose.yml | 36 ++++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index de17474..778e0e8 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,5 @@ For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). Before you deploy: `abra app cmd secrets --local` After you deploy: -- `cp -r frontend/* /srv/funkwhale/front/dist` - `abra app cmd api migrate` - `abra app cmd api admin` diff --git a/compose.yml b/compose.yml index eeb2d0b..53bc41d 100644 --- a/compose.yml +++ b/compose.yml @@ -31,6 +31,26 @@ x-volumes: &default-volumes - frontend-data:/srv/funkwhale/front/dist:ro services: + api: + image: funkwhale/funkwhale:1.2 + environment: *default-env + secrets: *default-secrets + volumes: + - music-data:/srv/funkwhale/data/music:ro + - media-data:/srv/funkwhale/data/media + - static-data:/srv/funkwhale/data/static + - frontend-data:/app/frontend:ro + depends_on: + - db + - cache + configs: + - source: app_entrypoint + target: /docker-entrypoint.sh + mode: 0555 + entrypoint: /docker-entrypoint.sh + command: /app/compose/django/server.sh + networks: + - internal app: image: nginx:1.27.1 environment: *default-env @@ -86,22 +106,6 @@ services: networks: - internal - api: - image: funkwhale/funkwhale:1.2 - environment: *default-env - secrets: *default-secrets - volumes: *default-volumes - depends_on: - - db - - cache - configs: - - source: app_entrypoint - target: /docker-entrypoint.sh - mode: 0555 - entrypoint: /docker-entrypoint.sh - command: /app/compose/django/server.sh - networks: - - internal db: image: postgres:10-alpine -- 2.49.0 From 9dde935a1dd11cc186234554334fa377c9a16be9 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 6 Feb 2025 16:37:39 -0300 Subject: [PATCH 2/3] fix: migrate during startup --- README.md | 1 - abra.sh | 2 +- entrypoint.sh.tmpl | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 778e0e8..fbbbee9 100644 --- a/README.md +++ b/README.md @@ -30,5 +30,4 @@ For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). Before you deploy: `abra app cmd secrets --local` After you deploy: -- `abra app cmd api migrate` - `abra app cmd api admin` diff --git a/abra.sh b/abra.sh index 9fb6f12..8ef4d3d 100644 --- a/abra.sh +++ b/abra.sh @@ -1,5 +1,5 @@ export NGINX_CONFIG_VERSION=v2 -export APP_ENTRYPOINT_VERSION=v1 +export APP_ENTRYPOINT_VERSION=v2 secrets() { docker context use default > /dev/null 2>&1 diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index f0c7f16..8f34852 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -29,6 +29,9 @@ export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale" file_env "DJANGO_SECRET_KEY" +# migrate before starting +python manage.py migrate + # upstream entrypoint # https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/api/Dockerfile /app/compose/django/entrypoint.sh "$@" -- 2.49.0 From a97746b1919f24a2a1beb6d81cd16f082e6421c6 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 6 Feb 2025 16:43:19 -0300 Subject: [PATCH 3/3] fix: the admin command requires a tty --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbbbee9..5ad3ec0 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,4 @@ For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). Before you deploy: `abra app cmd secrets --local` After you deploy: -- `abra app cmd api admin` +- `abra app cmd -T api admin` -- 2.49.0