Skip to content
Snippets Groups Projects
Commit a7a8a9b1 authored by hellekin's avatar hellekin Committed by Ciarán Ainsworth
Browse files

Improve Docker installation documentation

- Use `useradd` features to simplify user creation:
  - `-U` creates a user group,
  - `-G docker` adds the user to the `docker` group
- Document available versions and their usage
- Use `chmod 0600` before editing the file!
- Use `cat` instead of multiple `echo`es
- Comment all lines in `.env`
- Use `${FUNKWHALE_VERSION}` where applicable instead of `|version|` to
enable copy-pasting more commands
parent 8226a3b0
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,7 @@ Create the user and the directory: ...@@ -29,8 +29,7 @@ Create the user and the directory:
.. code-block:: shell .. code-block:: shell
sudo useradd -r -s /usr/bin/nologin -d /srv/funkwhale -m funkwhale sudo useradd -r -s /usr/bin/nologin -m -d /srv/funkwhale -U -G docker funkwhale
sudo adduser funkwhale docker
cd /srv/funkwhale cd /srv/funkwhale
Log in as the newly created user from now on: Log in as the newly created user from now on:
...@@ -39,7 +38,7 @@ Log in as the newly created user from now on: ...@@ -39,7 +38,7 @@ Log in as the newly created user from now on:
sudo -u funkwhale -H bash sudo -u funkwhale -H bash
Export the version you want to deploy: Export the `version you want <https://hub.docker.com/r/funkwhale/all-in-one/tags>`_ to deploy (e.g., ``0.19.1``):
.. parsed-literal:: .. parsed-literal::
...@@ -50,16 +49,24 @@ Create an env file to store a few important configuration options: ...@@ -50,16 +49,24 @@ Create an env file to store a few important configuration options:
.. code-block:: shell .. code-block:: shell
touch .env touch .env
echo "FUNKWHALE_HOSTNAME=yourdomain.funkwhale" >> .env chmod 600 .env # reduce permissions on the .env file since it contains sensitive data
echo "FUNKWHALE_PROTOCOL=https" >> .env # or http cat > .env <<EOD
echo "NGINX_MAX_BODY_SIZE=100M" >> .env # Replace 'your.funkwhale.example' with your actual domain
echo "FUNKWHALE_API_IP=127.0.0.1" >> .env FUNKWHALE_HOSTNAME=your.funkwhale.example
echo "FUNKWHALE_API_PORT=5000" >> .env # or the container port you want to expose on the host # Protocol may also be: http
echo "DJANGO_SECRET_KEY=$(openssl rand -hex 45)" >> .env # generate and store a secure secret key for your instance FUNKWHALE_PROTOCOL=https
# This limits the upload size
NGINX_MAX_BODY_SIZE=100M
# Bind to localhost
FUNKWHALE_API_IP=127.0.0.1
# Container port you want to expose on the host
FUNKWHALE_API_PORT=5000
# Generate and store a secure secret key for your instance
DJANGO_SECRET_KEY=$(openssl rand -hex 45)
# Remove this if you expose the container directly on ports 80/443 # Remove this if you expose the container directly on ports 80/443
echo "NESTED_PROXY=1" >> .env NESTED_PROXY=1
EOD
chmod 600 .env # reduce permissions on the .env file since it contains sensitive data
Then start the container: Then start the container:
...@@ -151,7 +158,7 @@ Multi-container installation ...@@ -151,7 +158,7 @@ Multi-container installation
First, ensure you have `Docker <https://docs.docker.com/engine/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_ installed. First, ensure you have `Docker <https://docs.docker.com/engine/installation/>`_ and `docker-compose <https://docs.docker.com/compose/install/>`_ installed.
Export the version you want to deploy: Export the `version you want <https://hub.docker.com/r/funkwhale/all-in-one/tags>`_ to deploy (e.g., ``0.19.1``):
.. parsed-literal:: .. parsed-literal::
...@@ -164,9 +171,9 @@ Download the sample docker-compose file: ...@@ -164,9 +171,9 @@ Download the sample docker-compose file:
mkdir /srv/funkwhale mkdir /srv/funkwhale
cd /srv/funkwhale cd /srv/funkwhale
mkdir nginx mkdir nginx
curl -L -o nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/docker.nginx.template" curl -L -o nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.nginx.template"
curl -L -o nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/docker.funkwhale_proxy.conf" curl -L -o nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.funkwhale_proxy.conf"
curl -L -o docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/docker-compose.yml" curl -L -o docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker-compose.yml"
At this point, the architecture of ``/srv/funkwhale`` should look like that: At this point, the architecture of ``/srv/funkwhale`` should look like that:
...@@ -182,7 +189,7 @@ Create your env file: ...@@ -182,7 +189,7 @@ Create your env file:
.. parsed-literal:: .. parsed-literal::
curl -L -o .env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/|version|/deploy/env.prod.sample" curl -L -o .env "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/env.prod.sample"
sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env
chmod 600 .env # reduce permissions on the .env file since it contains sensitive data chmod 600 .env # reduce permissions on the .env file since it contains sensitive data
sudo nano .env sudo nano .env
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment