diff --git a/docs/installation/docker.rst b/docs/installation/docker.rst index f47b90b84..edd48cdc9 100644 --- a/docs/installation/docker.rst +++ b/docs/installation/docker.rst @@ -25,11 +25,20 @@ Mono-container installation First, ensure you have `Docker `_ installed. -Then set up a directory for your data:: +Create the user and the directory: - mkdir /srv/funkwhale +.. code-block:: shell + + sudo useradd -r -s /usr/bin/nologin -d /srv/funkwhale -m funkwhale + sudo adduser funkwhale docker cd /srv/funkwhale +Log in as the newly created user from now on: + +.. code-block:: shell + + sudo -u funkwhale -H bash + Export the version you want to deploy: .. parsed-literal:: @@ -42,8 +51,8 @@ Create an env file to store a few important configuration options: touch .env echo "FUNKWHALE_HOSTNAME=yourdomain.funkwhale" >> .env - echo "FUNKWHALE_PROTOCOL=https" >> .env # or http - echo "DJANGO_SECRET_KEY=$(openssl rand -hex 45)" >> .env # generate and store a secure secret key for your instance + echo "FUNKWHALE_PROTOCOL=https" >> .env # or http + echo "DJANGO_SECRET_KEY=$(openssl rand -hex 45)" >> .env # generate and store a secure secret key for your instance Then start the container: @@ -76,8 +85,32 @@ Useful commands: - You can start and stop your instance using ``docker start funkwhale`` and ``docker stop funkwhale``, respectively - To have a better idea of the resource usage of your instance (CPU, memory), run ``docker stats funkwhale`` +.. note:: + The container will not pick up changes made in .env file automatically. + In order to load new configuration, run: + .. parsed-literal:: + + export FUNKWHALE_VERSION="|version|" + + .. code-block:: shell + + # stop and remove the existing container + docker stop funkwhale + docker rm funkwhale + # relaunch a new container + docker run \ + --name=funkwhale \ + --restart=unless-stopped \ + --env-file=/srv/funkwhale/.env \ + -v /srv/funkwhale/data:/data \ + -v /path/to/your/music/dir:/music:ro \ + -e PUID=$UID \ + -e PGID=$GID \ + -p 5000:80 \ + -d \ + funkwhale/all-in-one:$FUNKWHALE_VERSION .. _docker-multi-container: