Fix #614: added alternative funkwhale/all-in-one docker image

merge-requests/552/head
Eliot Berriot 2019-01-16 11:56:58 +01:00
rodzic b575999e22
commit e9e5b15d39
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
4 zmienionych plików z 119 dodań i 2 usunięć

Wyświetl plik

@ -1,7 +1,8 @@
variables:
IMAGE_NAME: funkwhale/funkwhale
IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
IMAGE_LATEST: $IMAGE_NAME:latest
ALL_IN_ONE_IMAGE_NAME: funkwhale/all-in-one
ALL_IN_ONE_IMAGE: $ALL_IN_ONE_IMAGE_NAME:$CI_COMMIT_REF_NAME
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
PYTHONDONTWRITEBYTECODE: "true"
REVIEW_DOMAIN: preview.funkwhale.audio
@ -201,6 +202,7 @@ build_front:
- tags@funkwhale/funkwhale
- master@funkwhale/funkwhale
- develop@funkwhale/funkwhale
tags:
- docker
@ -245,6 +247,32 @@ docker_release:
tags:
- docker-build
docker_all_in_one_release:
stage: deploy
image: bash
variables:
ALL_IN_ONE_REF: master
ALL_IN_ONE_ARTIFACT_URL: https://github.com/thetarkus/docker-funkwhale/archive/$ALL_IN_ONE_REF.zip
BUILD_PATH: all_in_one
before_script:
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- (if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then ./scripts/set-api-build-metadata.sh $(echo $CI_COMMIT_SHA | cut -c 1-8); fi);
script:
- wget $ALL_IN_ONE_ARTIFACT_URL -O all_in_one.zip
- unzip -o all_in_one.zip -d tmpdir
- mv tmpdir/docker-funkwhale-$ALL_IN_ONE_REF $BUILD_PATH && rmdir tmpdir
- cp -r api $BUILD_PATH/src/api
- cp -r front $BUILD_PATH/src/front
- cd $BUILD_PATH
- ./scripts/download-nginx-template.sh src/ $CI_COMMIT_REF_NAME
- docker build -t $ALL_IN_ONE_IMAGE .
- docker push $ALL_IN_ONE_IMAGE
only:
- develop@funkwhale/funkwhale
- tags@funkwhale/funkwhale
tags:
- docker-build
build_api:
# Simply publish a zip containing api/ directory
stage: deploy

Wyświetl plik

@ -0,0 +1 @@
Added alternative funkwhale/all-in-one docker image (#614)

Wyświetl plik

@ -184,3 +184,16 @@ and replace the ``location /api/`` and `location /` blocks by the following snip
Replace ``${FUNKWHALE_FRONTEND_PATH}`` by the corresponding variable from your .env file,
which should be ``/srv/funkwhale/front/dist`` by default, then reload your nginx process with
``sudo systemctl reload nginx``.
Alternative docker deployment method
------------------------------------
Thanks to the awesome done by @thetarkus at https://github.com/thetarkus/docker-funkwhale,
we're now able to provide an alternative and easier Docker deployment method!
In contrast with our current, multi-container offer, this method integrates
all Funkwhale processes and services (database, redis, etc.) into a single, easier to deploy container.
Both method will coexist in parallel, as each one has pros and cons. You can learn more
about this exciting new deployment option by visiting https://docs.funkwhale.audio/installation/docker.html!

Wyświetl plik

@ -1,8 +1,83 @@
Docker installation
====================
===================
Docker is the easiest way to get a Funkwhale instance up and running.
We support two types of Docker deployments:
- :ref:`Mono-container <docker-mono-container>`: all processes live in the same container (database, nginx, redis, etc.). It's easier to deploy and to integrate with container management systems like Portainer. However, it's not possible to scale this type of deployment on multiple servers.
- :ref:`Multi-container <docker-multi-container>`: each process lives in a dedicated container. This setup is more involved but also more flexible and scalable.
.. _docker-mono-container:
Mono-container installation
---------------------------
.. note::
This installation method was contributed by @thetarkus, at https://github.com/thetarkus/docker-funkwhale
First, ensure you have `Docker <https://docs.docker.com/engine/installation/>`_ installed.
Then set up a directory for your data::
mkdir /srv/funkwhale
cd /srv/funkwhale
Export the version you want to deploy:
.. parsed-literal::
export FUNKWHALE_VERSION="|version|"
Create an env file to store a few important configuration options:
.. code-block:: shell
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
Then start the container:
.. code-block:: shell
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
.. note::
- ``-e PUID`` and ``-e PGID`` are optional but useful to prevent permission issues with docker volumes
- ``-v /path/to/your/music/dir`` should point to a path on your host were is located music you want to import in your Funkwhale instance. You can safely remove the volume if you don't want to import music that way.
Your container should start in the background, and your instance be available at ``yourip:5000`` shortly.
You will need an admin account to login and manage your account, create one using the following command: ``docker exec -it funkwhale manage createsuperuser``
Useful commands:
- You can examine the logs by running ``docker logs -f --tail=50 funkwhale``
- 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``
.. _docker-multi-container:
Multi-container installation
----------------------------
First, ensure you have `Docker <https://docs.docker.com/engine/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_ installed.
Download the sample docker-compose file: