Add Docker instructions

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2415>
This commit is contained in:
Sporiff 2023-05-02 09:41:15 +02:00
parent 5b43ae4f2b
commit edb493a599
2 changed files with 57 additions and 30 deletions

View File

@ -167,50 +167,62 @@ That's it! Your Funkwhale pod is now up and running.
## 5. Set up your reverse proxy ## 5. Set up your reverse proxy
Funkwhale requires a reverse proxy to serve content to users. We recommend using [Nginx](https://nginx.com) to handle requests to your container. To do this: Funkwhale requires a reverse proxy to serve content to users. We recommend using [Nginx](https://nginx.com) to handle requests to your container. Follow this guide to install an Nginx configuration using details from your `.env` file.
1. Install Nginx. :::{note} Before you begin
Nginx isn't preinstalled on Debian. You can install it by running the following commands:
```{code-block} sh ```console
sudo apt-get update $ sudo apt update
sudo apt-get install nginx $ sudo apt install nginx
```
:::
% Nginx update instructions
1. Log in to a root shell to make changes to the config files
```console
$ sudo su
``` ```
2. Download the Nginx templates from Funkwhale. 2. Download the new Nginx templates from Funkwhale
```{code-block} sh ```console
sudo curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale_proxy.conf" # curl -L -o /etc/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/funkwhale_proxy.conf"
sudo curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/docker.proxy.template" # curl -L -o /etc/nginx/sites-available/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/$FUNKWHALE_VERSION/deploy/docker.proxy.template"
``` ```
3. Create an Nginx template with details from your `.env` file. 3. Update the Nginx configuration with details from your {file}`.env` file
```{code-block} sh ```console
# Log in to a root shell. # set -a && source /srv/funkwhale/config/.env && set +a
sudo su
# Create an Nginx configuration using the Funkwhale template with details from your `.env` file.
set -a && source /srv/funkwhale/.env && set +a
envsubst "`env | awk -F = '{printf \" $%s\", $$1}'`" \ envsubst "`env | awk -F = '{printf \" $%s\", $$1}'`" \
< /etc/nginx/sites-available/funkwhale.template \ < /etc/nginx/sites-available/funkwhale.template \
> /etc/nginx/sites-available/funkwhale.conf > /etc/nginx/sites-available/funkwhale.conf
# Enable the configuration so that Nginx serves it.
ln -s /etc/nginx/sites-available/funkwhale.conf /etc/nginx/sites-enabled/
# Exit the root shell.
exit
``` ```
That's it! You've created your Nginx file. Run the following command to check the `.env` details populated correctly. 4. Check the configuration file to make sure the template values have been updated properly
```{code-block} sh ```console
grep '${' /etc/nginx/sites-enabled/funkwhale.conf # grep '${' /etc/nginx/sites-available/funkwhale.conf
``` ```
% Instructions end
5. Create a symbolic link to the {file}`sites-enabled` directory to enable your configuration
```console
# ln -s /etc/nginx/sites-available/funkwhale.conf /etc/nginx/sites-enabled/
```
6. Restart Nginx
```console
# systemctl restart nginx
```
That's it! You've created your Nginx file.
### Override default Nginx templates ### Override default Nginx templates

View File

@ -62,6 +62,21 @@ exit
Thats it! Youve updated your Funkwhale pod. You should now see the new version running in your web browser. Thats it! Youve updated your Funkwhale pod. You should now see the new version running in your web browser.
## Update your reverse proxy configuration
To ensure your reverse proxy is up-to-date with changes, you should regenerate your Nginx configuration with each upgrade. To do this:
:::{include} /administrator/installation/docker.md
:start-after: Nginx update instructions
:end-before: Instructions end
:::
Once you've updated your configuration, restart Nginx.
```console
# systemctl restart nginx
```
## Upgrade the postgres container ## Upgrade the postgres container
Funkwhale depends on postgres for its database container. To upgrade postgres, you need to export your database and import it into the new container. Funkwhale depends on postgres for its database container. To upgrade postgres, you need to export your database and import it into the new container.