Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zwordi
funkwhale
Commits
28a30ac4
Verified
Commit
28a30ac4
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fix
#350
: saner defaults for STATIC_ROOT and MEDIA_ROOT in .env
parent
03eb2be2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changes/changelog.d/350.enhancement
+51
-0
51 additions, 0 deletions
changes/changelog.d/350.enhancement
deploy/docker-compose.yml
+5
-5
5 additions, 5 deletions
deploy/docker-compose.yml
deploy/env.prod.sample
+9
-7
9 additions, 7 deletions
deploy/env.prod.sample
with
65 additions
and
12 deletions
changes/changelog.d/350.enhancement
0 → 100644
+
51
−
0
View file @
28a30ac4
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
...
This diff is collapsed.
Click to expand it.
deploy/docker-compose.yml
+
5
−
5
View file @
28a30ac4
...
@@ -35,8 +35,8 @@ services:
...
@@ -35,8 +35,8 @@ services:
environment
:
environment
:
-
C_FORCE_ROOT=true
-
C_FORCE_ROOT=true
volumes
:
volumes
:
-
./data/music:
/music:ro
-
"
${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:${MUSIC_DIRECTORY_PATH-
/music
}
:ro
"
-
./data/media:/app/funkwhale_api/media
-
"
${MEDIA_ROOT}:${MEDIA_ROOT}"
celerybeat
:
celerybeat
:
restart
:
unless-stopped
restart
:
unless-stopped
...
@@ -52,9 +52,9 @@ services:
...
@@ -52,9 +52,9 @@ services:
image
:
funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
image
:
funkwhale/funkwhale:${FUNKWHALE_VERSION:-latest}
env_file
:
.env
env_file
:
.env
volumes
:
volumes
:
-
./data/music:
/music:ro
-
"
${MUSIC_DIRECTORY_SERVE_PATH-/srv/funkwhale/data/music}:${MUSIC_DIRECTORY_PATH-
/music
}
:ro
"
-
./data/media:/app/funkwhale_api/media
-
"
${MEDIA_ROOT}:${MEDIA_ROOT}"
-
./data/static:/app/staticfiles
-
"
${STATIC_ROOT}:${STATIC_ROOT}"
-
./front/dist:/frontend
-
./front/dist:/frontend
ports
:
ports
:
-
"
${FUNKWHALE_API_IP:-127.0.0.1}:${FUNKWHALE_API_PORT:-5000}:5000"
-
"
${FUNKWHALE_API_IP:-127.0.0.1}:${FUNKWHALE_API_PORT:-5000}:5000"
...
...
This diff is collapsed.
Click to expand it.
deploy/env.prod.sample
+
9
−
7
View file @
28a30ac4
...
@@ -10,14 +10,13 @@
...
@@ -10,14 +10,13 @@
# On non-docker setup **only**, you'll also have to tweak/uncomment those variables:
# On non-docker setup **only**, you'll also have to tweak/uncomment those variables:
# - DATABASE_URL
# - DATABASE_URL
# - CACHE_URL
# - CACHE_URL
# - STATIC_ROOT
# - MEDIA_ROOT
#
#
# You **don't** need to update those variables on pure docker setups.
# You **don't** need to update those variables on pure docker setups.
#
#
# Additional options you may want to check:
# Additional options you may want to check:
# - MUSIC_DIRECTORY_PATH and MUSIC_DIRECTORY_SERVE_PATH if you plan to use
# - MUSIC_DIRECTORY_PATH and MUSIC_DIRECTORY_SERVE_PATH if you plan to use
# in-place import
# in-place import
#
# Docker only
# Docker only
# -----------
# -----------
...
@@ -25,7 +24,6 @@
...
@@ -25,7 +24,6 @@
# (it will be interpolated in docker-compose file)
# (it will be interpolated in docker-compose file)
# You can comment or ignore this if you're not using docker
# You can comment or ignore this if you're not using docker
FUNKWHALE_VERSION=latest
FUNKWHALE_VERSION=latest
MUSIC_DIRECTORY_PATH=/music
# End of Docker-only configuration
# End of Docker-only configuration
...
@@ -79,12 +77,12 @@ REVERSE_PROXY_TYPE=nginx
...
@@ -79,12 +77,12 @@ REVERSE_PROXY_TYPE=nginx
# Where media files (such as album covers or audio tracks) should be stored
# Where media files (such as album covers or audio tracks) should be stored
# on your system?
# on your system?
# (Ensure this directory actually exists)
# (Ensure this directory actually exists)
#
MEDIA_ROOT=/srv/funkwhale/data/media
MEDIA_ROOT=/srv/funkwhale/data/media
# Where static files (such as API css or icons) should be compiled
# Where static files (such as API css or icons) should be compiled
# on your system?
# on your system?
# (Ensure this directory actually exists)
# (Ensure this directory actually exists)
#
STATIC_ROOT=/srv/funkwhale/data/static
STATIC_ROOT=/srv/funkwhale/data/static
# Update it to match the domain that will be used to reach your funkwhale
# Update it to match the domain that will be used to reach your funkwhale
# instance
# instance
...
@@ -112,5 +110,9 @@ RAVEN_DSN=https://44332e9fdd3d42879c7d35bf8562c6a4:0062dc16a22b41679cd5765e5342f
...
@@ -112,5 +110,9 @@ RAVEN_DSN=https://44332e9fdd3d42879c7d35bf8562c6a4:0062dc16a22b41679cd5765e5342f
# In-place import settings
# In-place import settings
# You can safely leave those settings uncommented if you don't plan to use
# You can safely leave those settings uncommented if you don't plan to use
# in place imports.
# in place imports.
# MUSIC_DIRECTORY_PATH=
# Typical docker setup:
# MUSIC_DIRECTORY_SERVE_PATH= # docker-only
# MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music
# MUSIC_DIRECTORY_SERVE_PATH=/music # docker-only
# Typical non-docker setup:
# MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music
# # MUSIC_DIRECTORY_SERVE_PATH= # stays commented, not needed
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment