docker.rst 1.93 KB
Newer Older
1
2
3
4
5
6
7
8
9
Docker installation
====================

Docker is the easiest way to get a funkwhale instance up and running.

First, ensure you have `Docker <https://docs.docker.com/engine/installation/>`_ and `docker-compose <https://github.com/docker/compose/releases>`_ installed.

Download the sample docker-compose file:

10
.. parsed-literal::
11
12
13

    mkdir -p /srv/funkwhale
    cd /srv/funkwhale
14
    curl -L -o docker-compose.yml "https://code.eliotberriot.com/funkwhale/funkwhale/raw/|version|/deploy/docker-compose.yml"
15
16
17

Create your env file:

18
.. parsed-literal::
19

20
    export FUNKWHALE_VERSION="|version|"
21
    curl -L -o .env "https://code.eliotberriot.com/funkwhale/funkwhale/raw/|version|/deploy/env.prod.sample"
22
    sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

Ensure to edit it to match your needs (this file is heavily commented)

Then, you should be able to pull the required images:

.. code-block:: bash

    docker-compose pull

Run the database container and the initial migrations:

.. code-block:: bash

    docker-compose up -d postgres
    docker-compose run --rm api python manage.py migrate

39
40
41
42
43
44
45
46
47
.. warning::

    You may sometimes get the following warning while applying migrations::

        "Your models have changes that are not yet reflected in a migration, and so won't be applied."

    This is a warning, not an error, and it can be safely ignored.
    Never run the ``makemigrations`` command yourself.

48
49
50
51
52
53
54
55
56
57
58
59
Create your admin user:

.. code-block:: bash

    docker-compose run --rm api python manage.py createsuperuser

Then launch the whole thing:

.. code-block:: bash

    docker-compose up -d

60
Now, you just need to configure your :ref:`reverse-proxy <reverse-proxy-setup>`. Don't worry, it's quite easy.
61
62
63
64
65

About music acquisition
-----------------------

If you want to :doc:`import music located on the server </importing-music>`, you can put it in the ``data/music`` directory and it will become readable by the importer.