Commit 502d6095 authored by Creak's avatar Creak
Browse files

Initial commit

parent d4a5cac0
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[.md]
trim_trailing_whitespace = false
templates/
{
"cSpell.words": [
"Funkwhale"
]
}
# funkwhale-docker
# Funkwhale Docker
This repo is here to help installing Funkwhale using Docker. It follows the
[multi-container installation documentation][docs-multi-container].
To set up your instance, run this script:
```sh
setup.sh
```
[docs-multi-container]: https://docs.funkwhale.audio/installation/docker.html#docker-multi-container
#!/bin/sh
FUNKWHALE_VERSION="1.2.2"
FUNKWHALE_HOSTNAME=""
while getopts "h:" "options"; do
case $options in
h)
FUNKWHALE_HOSTNAME=$OPTARG
;;
?)
exit 1
;;
esac
done
while [ -z $FUNKWHALE_HOSTNAME ]; do
read -ep "Please enter your Funkwhale hostname: " FUNKWHALE_HOSTNAME
done
echo -n "Fetching templates... "
mkdir -p templates/nginx
curl -sLo templates/nginx/funkwhale.template "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.nginx.template"
curl -sLo templates/nginx/funkwhale_proxy.conf "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker.funkwhale_proxy.conf"
curl -sLo templates/docker-compose.yml "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/docker-compose.yml"
curl -sLo templates/env.prod.sample "https://dev.funkwhale.audio/funkwhale/funkwhale/raw/${FUNKWHALE_VERSION}/deploy/env.prod.sample"
echo "done"
# Create .env and reduce permissions on the .env file since it contains
# sensitive data.
echo "Copy files"
mkdir nginx
cp templates/nginx/funkwhale.template nginx/
cp templates/nginx/funkwhale_proxy.conf nginx/
cp templates/docker-compose.yml .
cp templates/env.prod.sample .env
chmod 600 .env
echo "Set Funkwhale version: $FUNKWHALE_VERSION"
sed -i "s/FUNKWHALE_VERSION=latest/FUNKWHALE_VERSION=$FUNKWHALE_VERSION/" .env
echo "Set Funkwhale hostname: $FUNKWHALE_HOSTNAME"
sed -i "s/FUNKWHALE_HOSTNAME=yourdomain.funkwhale/FUNKWHALE_HOSTNAME=$FUNKWHALE_HOSTNAME/" .env
echo "Set Django secret key: xxxxxxxx"
DJANGO_SECRET_KEY=$(openssl rand -base64 45)
sed -i "s#DJANGO_SECRET_KEY=#DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY#" .env
echo "Pull the Docker images"
docker-compose pull
echo "Run initial DB migrations"
docker-compose up -d postgres
docker-compose run --rm api python manage.py migrate
echo "Create super user"
docker-compose run --rm api python manage.py createsuperuser
echo "Run the Funkwhale instance"
docker-compose up -d
echo "The instance is now running at https://$FUNKWHALE_HOSTNAME"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment