docs: assume Docker Compose defaults

This commit is contained in:
jon r 2024-09-04 11:52:26 +02:00
parent ed9eefce9a
commit c3efafca31
33 changed files with 101 additions and 112 deletions

View File

@ -408,7 +408,7 @@ Update instructions:
3. Bring the containers back up using the **docker compose** syntax. 3. Bring the containers back up using the **docker compose** syntax.
```sh ```sh
sudo docker compose up -d docker compose up -d
``` ```
After this you can continue to use the **docker compose** syntax for all Docker management tasks. After this you can continue to use the **docker compose** syntax for all Docker management tasks.

View File

@ -37,7 +37,7 @@ Running `fix_federation_ids` with the `--no-dry-run` flag is irreversible. Make
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fix_federation_ids https://old-url https://new-url --no-dry-run --no-input docker compose run --rm api funkwhale-manage fix_federation_ids https://old-url https://new-url --no-dry-run --no-input
``` ```
::: :::

View File

@ -19,7 +19,7 @@ sudo systemctl restart funkwhale.target
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose restart docker compose restart
``` ```
::: :::

View File

@ -99,7 +99,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage mrf_check --list docker compose run --rm api funkwhale-manage mrf_check --list
``` ```
::: :::
@ -124,7 +124,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
```{code-block} sh ```{code-block} sh
export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}' export MRF_MESSAGE='{"actor": "https://normal.domain/@alice", "type": "Create", "object": {"type": "Follow"}}'
echo $MRF_MESSAGE | sudo docker compose run --rm api funkwhale-manage mrf_check inbox - -p blocked_follow_domains echo $MRF_MESSAGE | docker compose run --rm api funkwhale-manage mrf_check inbox - -p blocked_follow_domains
``` ```
:::: ::::
@ -148,7 +148,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
```{code-block} sh ```{code-block} sh
export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}' export MRF_MESSAGE='{"actor": "https://botdomain.org/@bob", "type": "Create", "object": {"type": "Follow"}}'
echo $MRF_MESSAGE | sudo docker compose run --rm api funkwhale-manage mrf_check inbox - -p blocked_follow_domains echo $MRF_MESSAGE | docker compose run --rm api funkwhale-manage mrf_check inbox - -p blocked_follow_domains
``` ```
::: :::
@ -175,7 +175,7 @@ To make the job of writing and debugging MRF policies easier, we provide a manag
export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039" export ACTIVITY_UUID="06208aea-c687-4e8b-aefd-22f1c3f76039"
echo $MRF_MESSAGE | sudo docker compose run --rm api funkwhale-manage mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains echo $MRF_MESSAGE | docker compose run --rm api funkwhale-manage mrf_check inbox $ACTIVITY_UUID -p blocked_follow_domains
``` ```
@ -199,7 +199,7 @@ venv/bin/funkwhale-manage mrf_check --help
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage mrf_check --help docker compose run --rm api funkwhale-manage mrf_check --help
``` ```
::: :::

View File

@ -162,7 +162,7 @@ Serving files from an object store requires some changes to the reverse proxy.
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose restart docker compose restart
sudo systemctl restart nginx sudo systemctl restart nginx
``` ```

View File

@ -60,7 +60,7 @@ Celery uses a `prefork` pool by default. This enables the server to process many
2. Restart Celery. 2. Restart Celery.
```{code-block} sh ```{code-block} sh
sudo docker compose restart celerybeat docker compose restart celerybeat
``` ```
::: :::

View File

@ -24,7 +24,7 @@ venv/bin/funkwhale-manage import_files --help
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage import_files --help docker compose run --rm api funkwhale-manage import_files --help
``` ```
::: :::
@ -188,7 +188,7 @@ Funkwhale imports the music in your storage directory into the specified library
2. Run your import command against your music storage directory: 2. Run your import command against your music storage directory:
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place docker compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place
``` ```
Funkwhale imports the music in your storage directory into the specified library. Funkwhale imports the music in your storage directory into the specified library.
@ -250,7 +250,7 @@ venv/bin/funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nf
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch docker compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch
``` ```
::: :::
@ -281,7 +281,7 @@ venv/bin/funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nf
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune docker compose run --rm api funkwhale-manage import_files $LIBRARY_ID "/srv/funkwhale/data/music/nfsshare/" --recursive --noinput --in-place --watch --prune
``` ```
::: :::

View File

@ -126,19 +126,19 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
```{code-block} sh ```{code-block} sh
cd /srv/funkwhale cd /srv/funkwhale
sudo docker compose pull docker compose pull
``` ```
2. Bring up the database container so you can run the database migrations. 2. Bring up the database container so you can run the database migrations.
```{code-block} sh ```{code-block} sh
sudo docker compose up -d postgres docker compose up -d postgres
``` ```
3. Run the database migrations. 3. Run the database migrations.
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage migrate docker compose run --rm api funkwhale-manage migrate
``` ```
````{note} ````{note}
@ -154,13 +154,13 @@ Once you've filled in your environment file, you can set up Funkwhale. Follow th
4. Create your superuser. 4. Create your superuser.
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users create --superuser docker compose run --rm api funkwhale-manage fw users create --superuser
``` ```
5. Launch all the containers to bring up your pod. 5. Launch all the containers to bring up your pod.
```{code-block} sh ```{code-block} sh
sudo docker compose up -d docker compose up -d
``` ```
That's it! Your Funkwhale pod is now up and running. That's it! Your Funkwhale pod is now up and running.
@ -266,7 +266,7 @@ The frontend container ships default Nginx templates which serve content to the
6. Bring the `front` container up again to pick up the changes. 6. Bring the `front` container up again to pick up the changes.
```{code-block} sh ```{code-block} sh
sudo docker compose up -d front docker compose up -d front
``` ```
That's it! The container mounts your custom nginx files and uses its values to serve Funkwhale content. To revert to the default values, comment out the volumes by adding a `#` in front of them and bring the `front` container back up. That's it! The container mounts your custom nginx files and uses its values to serve Funkwhale content. To revert to the default values, comment out the volumes by adding a `#` in front of them and bring the `front` container back up.

View File

@ -62,7 +62,7 @@ On your {term}`destination server`, follow the [installation guide](docker.md).
Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over. Once you have finished the installation, stop the Funkwhale services. These shouldn't be running when you copy your existing data over.
```{code-block} sh ```{code-block} sh
sudo docker compose stop docker compose stop
``` ```
::: :::
@ -87,7 +87,7 @@ sudo -u postgres -H pg_dump funkwhale > /srv/funkwhale/dump.sql
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose exec postgres pg_dumpall -c -U postgres > dump.sql docker compose exec postgres pg_dumpall -c -U postgres > dump.sql
``` ```
::: :::
@ -157,19 +157,19 @@ You need to initialize the postgres container on your {term}`destination server`
CREATE USER funkwhale; \ CREATE USER funkwhale; \
GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;" > init.sql # Create an init.sql file with the correct permissions GRANT ALL PRIVILEGES ON DATABASE funkwhale TO funkwhale;" > init.sql # Create an init.sql file with the correct permissions
sudo docker compose run --rm postgres psql -U postgres -d postgres < "init.sql" # Import the init.sql file docker compose run --rm postgres psql -U postgres -d postgres < "init.sql" # Import the init.sql file
``` ```
2. Import your database backup. 2. Import your database backup.
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm postgres psql -U postgres -d postgres < "dump.sql" docker compose run --rm postgres psql -U postgres -d postgres < "dump.sql"
``` ```
3. When the import finishes, run the `funkwhale-manage migrate` command to set up the database. 3. When the import finishes, run the `funkwhale-manage migrate` command to set up the database.
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage migrate docker compose run --rm api funkwhale-manage migrate
``` ```
::: :::
@ -198,7 +198,7 @@ sudo systemctl start funkwhale.target
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose up -d docker compose up -d
``` ```
::: :::

View File

@ -47,7 +47,7 @@ venv/bin/funkwhale-manage create_library username1 --name="Library 1" --privacy-
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone" docker compose run --rm api funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone"
``` ```
::: :::
@ -79,7 +79,7 @@ venv/bin/funkwhale-manage create_library username1
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage create_library username1 docker compose run --rm api funkwhale-manage create_library username1
``` ```
::: :::
@ -111,7 +111,7 @@ venv/bin/funkwhale-manage create_library username1 --name="Library 1" --privacy-
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone" docker compose run --rm api funkwhale-manage create_library username1 --name="Library 1" --privacy-level="everyone"
``` ```
::: :::

View File

@ -25,7 +25,7 @@ venv/bin/funkwhale-manage check_inplace_files
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage check_inplace_files docker compose run --rm api funkwhale-manage check_inplace_files
``` ```
::: :::

View File

@ -23,7 +23,7 @@ venv/bin/funkwhale-manage fix_uploads --mimetype
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fix_uploads --mimetype docker compose run --rm api funkwhale-manage fix_uploads --mimetype
``` ```
::: :::
@ -48,7 +48,7 @@ venv/bin/funkwhale-manage fix_uploads --audio-data
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fix_uploads --audio-data docker compose run --rm api funkwhale-manage fix_uploads --audio-data
``` ```
::: :::
@ -73,7 +73,7 @@ venv/bin/funkwhale-manage fix_uploads --size
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fix_uploads --size docker compose run --rm api funkwhale-manage fix_uploads --size
``` ```
::: :::
@ -98,7 +98,7 @@ venv/bin/funkwhale-manage fix_uploads --checksum
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fix_uploads --checksum docker compose run --rm api funkwhale-manage fix_uploads --checksum
``` ```
::: :::
@ -123,7 +123,7 @@ venv/bin/funkwhale-manage fix_uploads --batch-size 500
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fix_uploads --batch-size 500 docker compose run --rm api funkwhale-manage fix_uploads --batch-size 500
``` ```
::: :::

View File

@ -29,7 +29,7 @@ venv/bin/funkwhale-manage prune_library --tracks
:sync: docker :sync: docker
```bash ```bash
sudo docker compose run --rm api funkwhale-manage prune_library --tracks docker compose run --rm api funkwhale-manage prune_library --tracks
``` ```
::: :::
@ -52,7 +52,7 @@ venv/bin/funkwhale-manage prune_library --albums
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage prune_library --albums docker compose run --rm api funkwhale-manage prune_library --albums
``` ```
::: :::
@ -75,7 +75,7 @@ venv/bin/funkwhale-manage prune_library --artists
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage prune_library --artists docker compose run --rm api funkwhale-manage prune_library --artists
``` ```
::: :::
@ -98,7 +98,7 @@ venv/bin/funkwhale-manage prune_library --tracks --albums --artists
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage prune_library --tracks --albums --artists docker compose run --rm api funkwhale-manage prune_library --tracks --albums --artists
``` ```
::: :::
@ -121,7 +121,7 @@ venv/bin/funkwhale-manage prune_library --help
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage prune_library --help docker compose run --rm api funkwhale-manage prune_library --help
``` ```
::: :::

View File

@ -25,7 +25,7 @@ venv/bin/funkwhale-manage prune_non_mbid_content
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage prune_non_mbid_content docker compose run --rm api funkwhale-manage prune_non_mbid_content
``` ```
::: :::

View File

@ -45,7 +45,7 @@ To add tags to untagged albums:
3. Run the `funkwhale-manage` command line interface to generate tags for untagged albums. 3. Run the `funkwhale-manage` command line interface to generate tags for untagged albums.
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw albums add-tags-from-tracks docker compose run --rm api funkwhale-manage fw albums add-tags-from-tracks
``` ```
::: :::
@ -88,7 +88,7 @@ To add tags to untagged artists:
3. Run the `funkwhale-manage` command line interface to generate tags for untagged artists. 3. Run the `funkwhale-manage` command line interface to generate tags for untagged artists.
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw artists add-tags-from-tracks docker compose run --rm api funkwhale-manage fw artists add-tags-from-tracks
``` ```
::: :::

View File

@ -53,7 +53,7 @@ To generate new thumbnails:
4. Run the `funkwhale-manage` command line interface to regenerate the thumbnails. 4. Run the `funkwhale-manage` command line interface to regenerate the thumbnails.
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw media generate-thumbnails docker compose run --rm api funkwhale-manage fw media generate-thumbnails
``` ```
::: :::

View File

@ -60,7 +60,7 @@ This command doesn't move files. It only updates the location of the file to its
3. Run the `funkwhale-manage` command line interface to update your in-place imports. 3. Run the `funkwhale-manage` command line interface to update your in-place imports.
```{code-block} console ```{code-block} console
$ sudo docker compose run --rm api funkwhale-manage inplace_to_s3 --no-dry-run $ docker compose run --rm api funkwhale-manage inplace_to_s3 --no-dry-run
``` ```
::: :::
@ -101,7 +101,7 @@ This command doesn't move files. It only updates the location of the file to its
3. Run the `funkwhale-manage` command line interface to update your in-place imports. 3. Run the `funkwhale-manage` command line interface to update your in-place imports.
```{code-block} console ```{code-block} console
$ sudo docker compose run --rm api funkwhale-manage inplace_to_s3 --source "/music" --no-dry-run $ docker compose run --rm api funkwhale-manage inplace_to_s3 --source "/music" --no-dry-run
``` ```
::: :::
@ -144,7 +144,7 @@ All in-place imports in the `/music` folder are updated to reference the `/music
3. Run the `funkwhale-manage` command line interface to update your in-place imports. 3. Run the `funkwhale-manage` command line interface to update your in-place imports.
```{code-block} console ```{code-block} console
$ sudo docker compose run --rm api funkwhale-manage inplace_to_s3 --source "/music" --target "/new_import" --no-dry-run $ docker compose run --rm api funkwhale-manage inplace_to_s3 --source "/music" --target "/new_import" --no-dry-run
``` ```
::: :::

View File

@ -25,7 +25,7 @@ venv/bin/funkwhale-manage fw users create
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users create docker compose run --rm api funkwhale-manage fw users create
``` ```
::: :::
@ -48,7 +48,7 @@ venv/bin/funkwhale-manage fw users create --username <username> --email <user em
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users create --username <username> --email <user email> -p "" docker compose run --rm api funkwhale-manage fw users create --username <username> --email <user email> -p ""
``` ```
::: :::
@ -73,7 +73,7 @@ venv/bin/funkwhale-manage fw users create --username <username> --email <user em
```{code-block} sh ```{code-block} sh
export FUNKWHALE_CLI_USER_PASSWORD=<password> export FUNKWHALE_CLI_USER_PASSWORD=<password>
sudo docker compose run --rm api funkwhale-manage fw users create --username <username> --email <user email> docker compose run --rm api funkwhale-manage fw users create --username <username> --email <user email>
``` ```
::: :::
@ -96,7 +96,7 @@ venv/bin/funkwhale-manage fw users --help
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users --help docker compose run --rm api funkwhale-manage fw users --help
``` ```
::: :::
@ -123,7 +123,7 @@ venv/bin/funkwhale-manage fw users set --upload-quota 500 <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --upload-quota 500 <user> docker compose run --rm api funkwhale-manage fw users set --upload-quota 500 <user>
``` ```
::: :::
@ -146,7 +146,7 @@ venv/bin/funkwhale-manage fw users set --staff --superuser <user 1> <user 2>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --staff --superuser <user 1> <user 2> docker compose run --rm api funkwhale-manage fw users set --staff --superuser <user 1> <user 2>
``` ```
::: :::
@ -169,7 +169,7 @@ venv/bin/funkwhale-manage fw users set --no-staff --no-superuser <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --no-staff --no-superuser <user> docker compose run --rm api funkwhale-manage fw users set --no-staff --no-superuser <user>
``` ```
::: :::
@ -192,7 +192,7 @@ venv/bin/funkwhale-manage fw users set --permission-moderation <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --permission-moderation <user> docker compose run --rm api funkwhale-manage fw users set --permission-moderation <user>
``` ```
::: :::
@ -215,7 +215,7 @@ venv/bin/funkwhale-manage fw users set --password "<password>" <user>
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --password "<password>" <user> docker compose run --rm api funkwhale-manage fw users set --password "<password>" <user>
``` ```
::: :::
@ -240,7 +240,7 @@ venv/bin/funkwhale-manage fw users set <user>
```{code-block} sh ```{code-block} sh
export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password> export FUNKWHALE_CLI_USER_UPDATE_PASSWORD=<password>
sudo docker compose run --rm api funkwhale-manage fw users set <user> docker compose run --rm api funkwhale-manage fw users set <user>
``` ```
::: :::
@ -263,7 +263,7 @@ venv/bin/funkwhale-manage fw users set --help
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users set --help docker compose run --rm api funkwhale-manage fw users set --help
``` ```
::: :::
@ -290,7 +290,7 @@ venv/bin/funkwhale-manage fw users rm <user>
:sync: docker :sync: docker
```{code-block} py ```{code-block} py
sudo docker compose run --rm api funkwhale-manage fw users rm <user> docker compose run --rm api funkwhale-manage fw users rm <user>
``` ```
::: :::
@ -315,7 +315,7 @@ venv/bin/funkwhale-manage fw users rm --hard <user>
:sync: docker :sync: docker
```{code-block} py ```{code-block} py
sudo docker compose run --rm api funkwhale-manage fw users rm --hard <user> docker compose run --rm api funkwhale-manage fw users rm --hard <user>
``` ```
::: :::
@ -338,7 +338,7 @@ venv/bin/funkwhale-manage fw users rm --help
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose run --rm api funkwhale-manage fw users rm --help docker compose run --rm api funkwhale-manage fw users rm --help
``` ```
::: :::

View File

@ -35,7 +35,7 @@ Follow this guide to migrate a mono-container installation to a multi-container
1. Create a backup of your Funkwhale database. We will import this into the new postgres container later. 1. Create a backup of your Funkwhale database. We will import this into the new postgres container later.
```{code-block} sh ```{code-block} sh
sudo docker compose exec funkwhale /usr/bin/pg_dumpall -U funkwhale > db_dump.sql docker compose exec funkwhale /usr/bin/pg_dumpall -U funkwhale > db_dump.sql
``` ```
## Stop your Funkwhale instance ## Stop your Funkwhale instance
@ -43,7 +43,7 @@ Follow this guide to migrate a mono-container installation to a multi-container
1. Stop all Funkwhale services. This ensures that no data is changed while you migrate your instance. 1. Stop all Funkwhale services. This ensures that no data is changed while you migrate your instance.
```{code-block} sh ```{code-block} sh
sudo docker compose down docker compose down
``` ```
## Prepare the multi-container setup ## Prepare the multi-container setup

View File

@ -47,7 +47,7 @@ journalctl -xn -u funkwhale-server
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose logs -f --tail=50 api # Follow the last 50 messages docker compose logs -f --tail=50 api # Follow the last 50 messages
``` ```
::: :::
@ -70,7 +70,7 @@ journalctl -xn -u funkwhale-worker
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose logs -f --tail=50 celery # Follow the last 50 messages docker compose logs -f --tail=50 celery # Follow the last 50 messages
``` ```
::: :::
@ -150,7 +150,7 @@ If your Funkwhale server uses more memory than expected, you can check the footp
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose restart docker compose restart
``` ```
::: :::
@ -189,7 +189,7 @@ To disable memory tracing:
:sync: docker :sync: docker
```{code-block} sh ```{code-block} sh
sudo docker compose restart docker compose restart
``` ```
::: :::

View File

@ -24,7 +24,7 @@ Before you remove any data, you need to stop the Funkwhale containers.
2. Stop the containers 2. Stop the containers
```{code-block} sh ```{code-block} sh
sudo docker compose down docker compose down
``` ```
## Remove the reverse proxy ## Remove the reverse proxy
@ -80,7 +80,7 @@ This action is __irreversible__. Make sure you have [backed up your data](../upg
Once you have stopped the containers, you can delete all containers and associated volumes. Once you have stopped the containers, you can delete all containers and associated volumes.
```{code-block} sh ```{code-block} sh
sudo docker compose rm -fsv docker compose rm -fsv
``` ```
## Remove the Funkwhale directory ## Remove the Funkwhale directory

View File

@ -21,13 +21,13 @@ Before performing big changes, we recommend you back up your database and media
1. Stop the running containers: 1. Stop the running containers:
```console ```console
$ sudo docker compose down $ docker compose down
``` ```
2. Dump the database to a backup file: 2. Dump the database to a backup file:
```console ```console
$ sudo docker compose run --rm postgres pg_dump -U postgres postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql $ docker compose run --rm postgres pg_dump -U postgres postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
``` ```
::: :::
@ -133,19 +133,19 @@ To restore your database, do the following:
1. Restore your database backup. 1. Restore your database backup.
```console ```console
$ sudo docker compose run --rm -T postgres psql -U postgres postgres < "/path/to/your/backup/dump.sql" $ docker compose run --rm -T postgres psql -U postgres postgres < "/path/to/your/backup/dump.sql"
``` ```
2. Run the `funkwhale-manage migrate` command to set up the database. 2. Run the `funkwhale-manage migrate` command to set up the database.
```console ```console
$ sudo docker compose run --rm api funkwhale-manage migrate $ docker compose run --rm api funkwhale-manage migrate
``` ```
3. Restart the services. 3. Restart the services.
```console ```console
$ sudo docker compose up -d $ docker compose up -d
``` ```
::: :::

View File

@ -36,7 +36,7 @@ Try to keep your tests small and focused. Each test should test a single functio
Test files must target a module and follow the `funkwhale_api` directory structure. If you write tests for `funkwhale_api/myapp/views.py`, you should put them in `tests/myapp/test_views.py`. Test files must target a module and follow the `funkwhale_api` directory structure. If you write tests for `funkwhale_api/myapp/views.py`, you should put them in `tests/myapp/test_views.py`.
``` ```
We provide utilities and fixtures to make writing tests as easy as possible. You can see the list of available fixtures by running `sudo docker compose -f dev.yml run --rm api pytest --fixtures`. We provide utilities and fixtures to make writing tests as easy as possible. You can see the list of available fixtures by running `docker compose run --rm api pytest --fixtures`.
### Factories ### Factories
@ -134,17 +134,17 @@ def test_downgrade_not_superuser_skips_email(factories, mocker):
You can run all tests in the pytest suite with the following command: You can run all tests in the pytest suite with the following command:
```sh ```sh
sudo docker compose -f dev.yml run --rm api pytest docker compose run --rm api pytest
``` ```
Run a specific test file by calling pytest against it: Run a specific test file by calling pytest against it:
```sh ```sh
sudo docker compose -f dev.yml run --rm api pytest tests/music/test_models.py docker compose run --rm api pytest tests/music/test_models.py
``` ```
You can check the full list of options by passing the `-h` flag: You can check the full list of options by passing the `-h` flag:
```sh ```sh
sudo docker compose -f dev.yml run --rm api pytest -h docker compose run --rm api pytest -h
``` ```

View File

@ -26,11 +26,11 @@ The Funkwhale frontend contains some tests to catch errors before changes go liv
To run the test suite, run the following command: To run the test suite, run the following command:
```sh ```sh
sudo docker compose -f dev.yml run --rm front yarn test:unit docker compose run --rm front yarn test:unit
``` ```
To run tests as you make changes, launch the test suite with the `-w` flag: To run tests as you make changes, launch the test suite with the `-w` flag:
```sh ```sh
sudo docker compose -f dev.yml run --rm front yarn test:unit -w docker compose run --rm front yarn test:unit -w
``` ```

View File

@ -40,7 +40,7 @@ You can install third-party plugins using the `funkwhale-manage` command line in
:::{tab-item} Docker :::{tab-item} Docker
```{code-block} shell ```{code-block} shell
sudo docker compose run --rm api funkwhale-manage fw plugins install https://plugin_url.zip docker compose run --rm api funkwhale-manage fw plugins install https://plugin_url.zip
``` ```
::: :::

View File

@ -30,16 +30,10 @@ Funkwhale can be run in Docker containers for local development. You can work on
## Set up your Docker environment ## Set up your Docker environment
````{note} ```{note}
Funkwhale provides a `compose.yml` file following the default file naming convention of a Docker Compose manifest. For Linux users, we assume that you finished the post-install steps to [manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).
Funkwhale provides a `dev.yml` file that contains the required docker compose setup. You need to pass the `-f dev.yml` flag you run docker compose commands to ensure it uses this file. If you don't want to add this each time, you can export it as a `COMPOSE_FILE` variable:
```sh
export COMPOSE_FILE=dev.yml
``` ```
````
To set up your Docker environment: To set up your Docker environment:
1. Create a `.env` file to enable customization of your setup. 1. Create a `.env` file to enable customization of your setup.
@ -64,7 +58,7 @@ To set up your Docker environment:
Once you've set everything up, you need to build the containers. Run this command any time there are upstream changes or dependency changes to ensure you're up-to-date. Once you've set everything up, you need to build the containers. Run this command any time there are upstream changes or dependency changes to ensure you're up-to-date.
```sh ```sh
sudo docker compose -f dev.yml build docker compose build
``` ```
## Set up the database ## Set up the database
@ -72,7 +66,7 @@ sudo docker compose -f dev.yml build
Funkwhale relies on a postgresql database to store information. To set this up, you need to run the `funkwhale-manage migrate` command: Funkwhale relies on a postgresql database to store information. To set this up, you need to run the `funkwhale-manage migrate` command:
```sh ```sh
sudo docker compose -f dev.yml run --rm api funkwhale-manage migrate docker compose run --rm api funkwhale-manage migrate
``` ```
This command creates all the required tables. You need to run this whenever there are changes to the API schema. You can run this at any time without causing issues. This command creates all the required tables. You need to run this whenever there are changes to the API schema. You can run this at any time without causing issues.
@ -84,7 +78,7 @@ You need to create some local data to mimic a production environment.
1. Create a superuser so you can log in to your local app: 1. Create a superuser so you can log in to your local app:
```sh ```sh
sudo docker compose -f dev.yml run --rm api funkwhale-manage fw users create --superuser docker compose run --rm api funkwhale-manage fw users create --superuser
``` ```
2. Add some fake data to populate the database. The following command creates 25 artists with random albums, tracks, and metadata. 2. Add some fake data to populate the database. The following command creates 25 artists with random albums, tracks, and metadata.
@ -92,7 +86,7 @@ You need to create some local data to mimic a production environment.
```sh ```sh
artists=25 # Adds 25 fake artists artists=25 # Adds 25 fake artists
command="from funkwhale_api.music import fake_data; fake_data.create_data($artists)" command="from funkwhale_api.music import fake_data; fake_data.create_data($artists)"
echo $command | sudo docker compose -f dev.yml run --rm -T api funkwhale-manage shell -i python echo $command | docker compose run --rm -T api funkwhale-manage shell -i python
``` ```
## Manage services ## Manage services
@ -100,7 +94,7 @@ You need to create some local data to mimic a production environment.
Once you have set up your containers, launch all services to start working on them: Once you have set up your containers, launch all services to start working on them:
```sh ```sh
sudo docker compose -f dev.yml up front api nginx celeryworker docker compose up front api nginx celeryworker
``` ```
This gives you access to the following: This gives you access to the following:
@ -112,13 +106,13 @@ This gives you access to the following:
Once you're done with the containers, you can stop them all: Once you're done with the containers, you can stop them all:
```sh ```sh
sudo docker compose -f dev.yml stop docker compose stop
``` ```
If you want to destroy your containers, run the following: If you want to destroy your containers, run the following:
```sh ```sh
sudo docker compose -f dev.yml down -v docker compose down -v
``` ```
## Set up federation support ## Set up federation support
@ -178,7 +172,7 @@ To run a reverse proxy for your app:
2. Launch traefik using the bundled configuration: 2. Launch traefik using the bundled configuration:
```sh ```sh
sudo docker compose -f docker/traefik.yml up -d docker compose -f docker/traefik.yml up -d
``` ```
3. Set up as many different projects as you need. Make sure the `COMPOSE_PROJECT_NAME` and `VUE_PORT` variables are unique per instance 3. Set up as many different projects as you need. Make sure the `COMPOSE_PROJECT_NAME` and `VUE_PORT` variables are unique per instance
@ -186,9 +180,9 @@ To run a reverse proxy for your app:
```sh ```sh
export COMPOSE_PROJECT_NAME=node2 export COMPOSE_PROJECT_NAME=node2
export VUE_PORT=1234 # this has to be unique for each instance export VUE_PORT=1234 # this has to be unique for each instance
sudo docker compose -f dev.yml run --rm api funkwhale-manage migrate docker compose run --rm api funkwhale-manage migrate
sudo docker compose -f dev.yml run --rm api funkwhale-manage fw users create --superuser docker compose run --rm api funkwhale-manage fw users create --superuser
sudo docker compose -f dev.yml up nginx api front nginx api celeryworker docker compose up nginx api front nginx api celeryworker
``` ```
You can access your project at `https://{COMPOSE_PROJECT_NAME}.funkwhale.test`. You can access your project at `https://{COMPOSE_PROJECT_NAME}.funkwhale.test`.

View File

@ -9174,7 +9174,7 @@ msgstr ""
#~ msgid "```sh sudo docker-compose down ```" #~ msgid "```sh sudo docker-compose down ```"
#~ msgstr "" #~ msgstr ""
#~ msgid "```sh sudo docker compose up -d ```" #~ msgid "```sh docker compose up -d ```"
#~ msgstr "" #~ msgstr ""
#~ msgid "" #~ msgid ""
@ -10079,4 +10079,3 @@ msgstr ""
#~ "shortcut to toggle the currently playing" #~ "shortcut to toggle the currently playing"
#~ " track as a favorite (#53)" #~ " track as a favorite (#53)"
#~ msgstr "" #~ msgstr ""

View File

@ -144,7 +144,7 @@ msgstr ""
msgid "" msgid ""
"We provide utilities and fixtures to make writing tests as easy as " "We provide utilities and fixtures to make writing tests as easy as "
"possible. You can see the list of available fixtures by running `sudo " "possible. You can see the list of available fixtures by running `sudo "
"docker compose -f dev.yml run --rm api pytest --fixtures`." "docker compose run --rm api pytest --fixtures`."
msgstr "" msgstr ""
#: ../../developer_documentation/contribute/api.md:41 #: ../../developer_documentation/contribute/api.md:41
@ -183,4 +183,3 @@ msgstr ""
#: ../../developer_documentation/contribute/api.md:146 #: ../../developer_documentation/contribute/api.md:146
msgid "You can check the full list of options by passing the `-h` flag:" msgid "You can check the full list of options by passing the `-h` flag:"
msgstr "" msgstr ""

View File

@ -9174,7 +9174,7 @@ msgstr ""
#~ msgid "```sh sudo docker-compose down ```" #~ msgid "```sh sudo docker-compose down ```"
#~ msgstr "" #~ msgstr ""
#~ msgid "```sh sudo docker compose up -d ```" #~ msgid "```sh docker compose up -d ```"
#~ msgstr "" #~ msgstr ""
#~ msgid "" #~ msgid ""
@ -10079,4 +10079,3 @@ msgstr ""
#~ "shortcut to toggle the currently playing" #~ "shortcut to toggle the currently playing"
#~ " track as a favorite (#53)" #~ " track as a favorite (#53)"
#~ msgstr "" #~ msgstr ""

View File

@ -144,7 +144,7 @@ msgstr ""
msgid "" msgid ""
"We provide utilities and fixtures to make writing tests as easy as " "We provide utilities and fixtures to make writing tests as easy as "
"possible. You can see the list of available fixtures by running `sudo " "possible. You can see the list of available fixtures by running `sudo "
"docker compose -f dev.yml run --rm api pytest --fixtures`." "docker compose run --rm api pytest --fixtures`."
msgstr "" msgstr ""
#: ../../developer_documentation/contribute/api.md:41 #: ../../developer_documentation/contribute/api.md:41
@ -183,4 +183,3 @@ msgstr ""
#: ../../developer_documentation/contribute/api.md:146 #: ../../developer_documentation/contribute/api.md:146
msgid "You can check the full list of options by passing the `-h` flag:" msgid "You can check the full list of options by passing the `-h` flag:"
msgstr "" msgstr ""

View File

@ -9181,7 +9181,7 @@ msgstr ""
#~ msgid "```sh sudo docker-compose down ```" #~ msgid "```sh sudo docker-compose down ```"
#~ msgstr "" #~ msgstr ""
#~ msgid "```sh sudo docker compose up -d ```" #~ msgid "```sh docker compose up -d ```"
#~ msgstr "" #~ msgstr ""
#~ msgid "" #~ msgid ""

View File

@ -144,7 +144,7 @@ msgstr ""
msgid "" msgid ""
"We provide utilities and fixtures to make writing tests as easy as " "We provide utilities and fixtures to make writing tests as easy as "
"possible. You can see the list of available fixtures by running `sudo " "possible. You can see the list of available fixtures by running `sudo "
"docker compose -f dev.yml run --rm api pytest --fixtures`." "docker compose run --rm api pytest --fixtures`."
msgstr "" msgstr ""
#: ../../developer_documentation/contribute/api.md:41 #: ../../developer_documentation/contribute/api.md:41
@ -183,4 +183,3 @@ msgstr ""
#: ../../developer_documentation/contribute/api.md:146 #: ../../developer_documentation/contribute/api.md:146
msgid "You can check the full list of options by passing the `-h` flag:" msgid "You can check the full list of options by passing the `-h` flag:"
msgstr "" msgstr ""

View File

@ -109,7 +109,7 @@ msgid "Test files must target a module and follow the `funkwhale_api` directory
msgstr "" msgstr ""
#: ../../developer/contribute/api.md:39 #: ../../developer/contribute/api.md:39
msgid "We provide utilities and fixtures to make writing tests as easy as possible. You can see the list of available fixtures by running `sudo docker compose -f dev.yml run --rm api pytest --fixtures`." msgid "We provide utilities and fixtures to make writing tests as easy as possible. You can see the list of available fixtures by running `docker compose run --rm api pytest --fixtures`."
msgstr "" msgstr ""
#: ../../developer/contribute/api.md:41 #: ../../developer/contribute/api.md:41