Adds Redis cache (#4)

Requires adding a Redis host password through `redis_host_password`.

If you are updating you existing Nextcloud, you might have to manually update the `<nextcloud-data-volume>/config/config.php` and replace `memcache...` properties with:

```
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.local' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
     'host' => 'redis',
     'port' => 6379,
     ),
```

Co-authored-by: Jan Beilicke <dev@jotbe.io>
Reviewed-on: #4
This commit is contained in:
Jan Beilicke 2023-10-29 19:40:26 +01:00
parent 13e163913a
commit 9ffd149c65
2 changed files with 21 additions and 0 deletions

View file

@ -69,6 +69,17 @@
SMTP_PASSWORD={{ smtp_password }}
MAIL_FROM_ADDRESS={{ mail_from_address }}
MAIL_DOMAIN={{ mail_domain }}
REDIS_HOST=redis
REDIS_HOST_PASSWORD={{ redis_host_password }}
- name: Provide Redis env vars
copy:
dest: /home/{{ docker_user }}/nextcloud/redis.env
owner: "{{ docker_user }}"
group: "{{ docker_user }}"
mode: '0640'
content: |
REDIS_PASSWORD={{ redis_host_password }}
- name: Provide restic-compose-backup env vars
copy:

View file

@ -25,12 +25,21 @@ services:
container_name: nextcloud-app
depends_on:
- mysqldb
- redis
volumes:
- nextcloud:/var/www/html
- /etc/localtime:/etc/localtime:ro
env_file:
- nextcloud.env
redis:
image: bitnami/redis:latest
restart: unless-stopped
volumes:
- redis:/data
env_file:
- redis.env
web:
image: nginx
restart: always
@ -85,6 +94,7 @@ services:
volumes:
mysqldb:
redis:
nextcloud:
{% if nextcloud_enable_restic_compose_backup %}
backup-cache: