diff --git a/playbook.yml b/playbook.yml index c1cf25d8..f194d7fa 100644 --- a/playbook.yml +++ b/playbook.yml @@ -143,6 +143,14 @@ - role: docker-bigbluebutton vars: domain: bbb.{{top_domain}} +- name: setup funkwhale hosts + hosts: funkwhale_hosts + become: true + roles: + - role: docker-funkwhale + vars: + domain: funkwhale.{{top_domain}} + http_port: 8012 - name: setup akaunting hosts hosts: akaunting_hosts become: true diff --git a/roles/docker-funkwhale/README.md b/roles/docker-funkwhale/README.md new file mode 100644 index 00000000..b3ddcb4d --- /dev/null +++ b/roles/docker-funkwhale/README.md @@ -0,0 +1,4 @@ +# role funkwhale + +## further information +- https://docs.funkwhale.audio/installation/docker.html \ No newline at end of file diff --git a/roles/docker-funkwhale/handlers/main.yml b/roles/docker-funkwhale/handlers/main.yml new file mode 100644 index 00000000..965d57ad --- /dev/null +++ b/roles/docker-funkwhale/handlers/main.yml @@ -0,0 +1,8 @@ +--- +- name: recreate funkwhale + command: + cmd: docker-compose -p funkwhale up -d --force-recreate + chdir: /home/administrator/docker-compose/funkwhale/ + environment: + COMPOSE_HTTP_TIMEOUT: 600 + DOCKER_CLIENT_TIMEOUT: 600 diff --git a/roles/docker-funkwhale/meta/main.yml b/roles/docker-funkwhale/meta/main.yml new file mode 100644 index 00000000..fb4d4f7b --- /dev/null +++ b/roles/docker-funkwhale/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: +- native-docker-reverse-proxy diff --git a/roles/docker-funkwhale/tasks/main.yml b/roles/docker-funkwhale/tasks/main.yml new file mode 100644 index 00000000..0438ec9e --- /dev/null +++ b/roles/docker-funkwhale/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: recieve {{domain}} certificate + command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}} + +- name: configure {{domain}}.conf + template: src=roles/native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf + notify: restart nginx + +- name: "create {{docker_compose_path}}" + file: + path: "{{docker_compose_path}}" + state: directory + mode: 0755 + +- name: add docker-compose.yml + template: src=docker-compose.yml.j2 dest={{docker_compose_path}}docker-compose.yml + notify: recreate funkwhale + +- name: add env + template: + src: env.j2 + dest: "{{docker_compose_path}}env" + mode: '770' + force: yes + notify: recreate funkwhale \ No newline at end of file diff --git a/roles/docker-funkwhale/templates/docker-compose.yml.j2 b/roles/docker-funkwhale/templates/docker-compose.yml.j2 new file mode 100644 index 00000000..6e4ab935 --- /dev/null +++ b/roles/docker-funkwhale/templates/docker-compose.yml.j2 @@ -0,0 +1,13 @@ +version: "3" +services: + funkwhale: + container_name: funkwhale + restart: unless-stopped + image: funkwhale/all-in-one:{{funkwhale_version}} + env_file: env + volumes: + - data:/data + ports: + - "127.0.0.1:{{http_port}}:{{http_port}}" +volumes: + data: \ No newline at end of file diff --git a/roles/docker-funkwhale/templates/env.j2 b/roles/docker-funkwhale/templates/env.j2 new file mode 100644 index 00000000..c11d9f99 --- /dev/null +++ b/roles/docker-funkwhale/templates/env.j2 @@ -0,0 +1,12 @@ +FUNKWHALE_HOSTNAME={{domain}} +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={{http_port}} +# Generate and store a secure secret key for your instance +DJANGO_SECRET_KEY={{funkwhale_django_secret}} +# Remove this if you expose the container directly on ports 80/443 +NESTED_PROXY=1 \ No newline at end of file diff --git a/roles/docker-funkwhale/vars/main.yml b/roles/docker-funkwhale/vars/main.yml new file mode 100644 index 00000000..4d75d754 --- /dev/null +++ b/roles/docker-funkwhale/vars/main.yml @@ -0,0 +1,2 @@ +docker_compose_path: "/home/administrator/docker-compose/funkwhale/" +client_max_body_size: "512M"