Pins Nextcloud to version 27 and switches from Apache to Nginx to improve performance esp. of video streaming (#2)

Streaming videos had been a pain with the default Nextcloud Docker image which uses Apache. This PR will replace that Docker image with Nextcloud 27 FPM and provides an Nginx to serve the app.

Additionally, with moving from the latest Nextcloud (-Apache) image to a pinned version, it will be way clearer, which version is about to be deployed, major upgrades have to be done consciously and without skipping major versions which Nextcloud does not support.

Co-authored-by: Jan Beilicke <dev@jotbe.io>
Reviewed-on: #2
This commit is contained in:
Jan Beilicke 2023-10-28 23:38:27 +02:00
parent 5b39dfb6fa
commit d860a9c086
5 changed files with 200 additions and 16 deletions

View file

@ -7,6 +7,14 @@
owner: '{{ docker_user }}'
group: '{{ docker_user }}'
- name: Provide nginx.conf
copy:
src: nginx.conf
dest: /home/{{ docker_user }}/nextcloud/nginx.conf
owner: "{{ docker_user }}"
group: "{{ docker_user }}"
mode: '0644'
- name: Provide docker-compose.yml
template:
src: templates/docker-compose.nextcloud.yml.j2
@ -99,11 +107,12 @@
- assert:
that:
- "output.ansible_facts['nextcloud-app']['nextcloud-app'].state.running"
- "output.services['nextcloud-app']['nextcloud-app'].state.running"
- "output.services['web']['nextcloud_web_1'].state.running"
- name: Get container IP
set_fact:
nextcloud_ip: "{{ output.ansible_facts['nextcloud-app']['nextcloud-app'].networks.nextcloud_default.IPAddress }}"
nextcloud_ip: "{{ output.services['web']['nextcloud_web_1'].networks.nextcloud_default.IPAddress }}"
- name: "Waiting for Nextcloud container to become available"
become: false
@ -131,16 +140,14 @@
become: false
uri:
url: "{{ nextcloud_overwrite_cli_url }}/login"
return_content: yes
timeout: 300
validate_certs: no
register: url_check
delegate_to: localhost
until: "'Nextcloud' in url_check.content"
retries: 5
delay: 10
tags: health
- debug:
var: url_check
tags: debug
tags:
- never
- debug