52 lines
2.7 KiB
Plaintext
52 lines
2.7 KiB
Plaintext
Ensure we have sane defaults for MEDIA_ROOT, STATIC_ROOT and MUSIC_DIRECTORY_PATH
|
|
in the deployment .env file (#350)
|
|
|
|
Ensure MEDIA_ROOT, STATIC_ROOT and MUSIC_DIRECTORY_* are set explicitely
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
In our default .env file, MEDIA_ROOT and STATIC_ROOT were commented by default, causing
|
|
some deployment issues on non-docker setups when people forgot to uncomment them.
|
|
|
|
From now on, those variables are uncommented, and will also be used on docker setups
|
|
to mount the volumes automatically in the docker-compose.yml file. This has been a source
|
|
of headache as well in some deployments, where you had to update both the .env file and
|
|
the compose file.
|
|
|
|
This also applies to in-place paths (MUSIC_DIRECTORY_PATH and MUSIC_DIRECTORY_SERVE_PATH),
|
|
whose values are now used directly to set up the proper Docker volumes.
|
|
|
|
This will only affect new deployments though. If you want to benefit from this on an
|
|
existing instance, do a backup of your ``.env`` and ``docker-compose.yml`` files and apply the following changes:
|
|
|
|
- Ensure ``MEDIA_ROOT`` is uncommented in your .env file and match the absolute path where media files are stored
|
|
on your host (``/srv/funkwhale/data/media`` by default)
|
|
- Ensure ``STATIC_ROOT`` is uncommented in your .env file and match the absolute path where static files are stored
|
|
on your host (``/srv/funkwhale/data/static`` by default)
|
|
- If you use in-place import:
|
|
- Ensure MUSIC_DIRECTORY_PATH is uncommented and set to ``/music``
|
|
- Ensure MUSIC_DIRECTORY_SERVE_PATH is uncommented and set to the absolute path on your host were your music files
|
|
are stored (``/srv/funkwhale/data/music`` by default)
|
|
- Edit your docker-compose.yml file to reflect the changes:
|
|
- Search for volumes (there should be two occurences) that contains ``/app/funkwhale_api/media`` on the right side, and
|
|
replace the whole line with ``- "${MEDIA_ROOT}:${MEDIA_ROOT}"``
|
|
- Search for a volume that contains ``/app/staticfiles`` on the right side, and
|
|
replace the whole line with ``- "${STATIC_ROOT}:${STATIC_ROOT}"``
|
|
- If you use in-place import, search for volumes (there should be two occurences) that contains ``/music:ro`` on the right side, and
|
|
replace the whole line with ``- "${MUSIC_DIRECTORY_SERVE_PATH}:${MUSIC_DIRECTORY_PATH}:ro"``
|
|
|
|
In the end, the ``volumes`` directives of your containers should look like that::
|
|
|
|
...
|
|
celeryworker
|
|
volumes:
|
|
- "${MUSIC_DIRECTORY_SERVE_PATH}:${MUSIC_DIRECTORY_PATH}:ro"
|
|
- "${MEDIA_ROOT}:${MEDIA_ROOT}"
|
|
...
|
|
api:
|
|
volumes:
|
|
- "${MUSIC_DIRECTORY_SERVE_PATH}:${MUSIC_DIRECTORY_PATH}:ro"
|
|
- "${MEDIA_ROOT}:${MEDIA_ROOT}"
|
|
- "${STATIC_ROOT}:${STATIC_ROOT}"
|
|
- ./front/dist:/frontend
|
|
...
|