Skip to content

Commit

Permalink
nextcloud: redis -> valkey
Browse files Browse the repository at this point in the history
  • Loading branch information
SaswatPadhi committed Jan 19, 2025
1 parent e74a688 commit 8e7f3b6
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 117 deletions.
103 changes: 2 additions & 101 deletions nextcloud/README.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,5 @@
# Nextcloud

<table>
<thead>
<tr>
<th colspan='4' align='center'>╭── &nbsp; Composition &nbsp; &nbsp; \ &nbsp; &nbsp; Supported Archs &nbsp; ─── </th>
<th align='center'><sub>amd64</sub></th>
<th align='center'><sub>386</sub></th>
<th align='center'><sub>arm/v6</sub></th>
<th align='center'><sub>arm/v7</sub></th>
<th align='center'><sub>arm64</sub></th>
<th align='center'><sub>ppc64le</sub></th>
</tr>
</thead>
<tbody>
<tr>
<th>
<a href='https://nextcloud.com/'>Nextcloud</a>
<br>
<sub>:443/nextcloud</sub>
<hr>
<a href='https://github.com/padhi-homelab/services/actions?query=workflow%3A%22Docker+Compose+Test+%28Nextcloud%29%22'><img src='https://img.shields.io/github/workflow/status/padhi-homelab/services/Docker%20Compose%20Test%20(Nextcloud)?logo=github&logoWidth=24&style=flat-square&label=tests'></img></a>
</th>
<th>
B <br> B <br> B <br> B
</th>
<th align='right'>
<a href='https://hub.docker.com/_/mariadb'>
<sub>mariadb</sub>
</a>
<a href='https://hub.docker.com/_/redis'>
<sub>redis</sub>
</a>
<br>
<a href='https://hub.docker.com/_/nextcloud'>
<sub>nextcloud</sub>
</a>
<br>
<a href='https://hub.docker.com/_/nextcloud'>
<sub>cron</sub>
</a>
</th>
<td align='center'>
<code><sub>10.9.3</sub></code>
<br>
<code><sub>7.0.5</sub></code>
<br>
<code><sub>30.0.1-core</sub></code>
<br>
<code><sub>30.0.1-core</sub></code>
</td>
<td align='center'>
:heavy_check_mark:
</td>
<td align='center'>
:heavy_multiplication_x:
<br>
:heavy_check_mark:
<br>
:heavy_check_mark:
<br>
:heavy_check_mark:
</td>
<td align='center'>
:heavy_multiplication_x:
<br>
:heavy_check_mark:
<br>
:heavy_check_mark:
<br>
:heavy_check_mark:
</td>
<td align='center'>
:heavy_multiplication_x:
<br>
:heavy_check_mark:
<br>
:heavy_check_mark:
<br>
:heavy_check_mark:
</td>
<td align='center'>
:heavy_check_mark:
</td>
<td align='center'>
:heavy_check_mark:
</td>
</tr>
</tbody>
</table>


## Exposure

- Ports:
- `80` ; NOT exposed to host

- Reverse Proxy
- `traefik` ; dynamic routing via docker labels
- Entrypoint: `SERVER_WAN_HTTPS_PORT` (see: [static.global.env](../static.global.env))
- Subfolder: `/nextcloud`


## Bug Fixes

Expand All @@ -115,6 +15,7 @@ Implemented solution proposed in [comment-1213540687](https://github.com/nextclo

Implemented solution proposed in [comment-1308141561](https://github.com/nextcloud/docker/issues/1740#issuecomment-1308141561).


## Enhancements

### Security
Expand All @@ -127,7 +28,7 @@ Implemented solution proposed in [comment-1308141561](https://github.com/nextclo

### Usability

1. Proper [carddav and caldav redirection](docker-compose.labels.yml#L8-L10)
1. Proper [carddav and caldav redirection](docker-compose.labels.yml)
with subfolder in Traefik

2. Ability to edit crontab file (`data/nextcloud/crontabs/user`, generated after first run)
Expand Down
2 changes: 1 addition & 1 deletion nextcloud/docker-compose.logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
options:
max-size: "1m"
max-file: "1"
redis:
valkey:
logging:
options:
max-size: "1m"
Expand Down
2 changes: 1 addition & 1 deletion nextcloud/docker-compose.pre_hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DATA_DIR="$SELF_DIR/data"

mkdir -p "$DATA_DIR/fulltextsearch/usr/share/elasticsearch/data" \
"$DATA_DIR/mariadb/var/lib/mysql" \
"$DATA_DIR/redis/data" \
"$DATA_DIR/valkey/data" \
"$DATA_DIR/nextcloud/crontabs" \
"$DATA_DIR/nextcloud/data" \
"$DATA_DIR/nextcloud/var/www/html" \
Expand Down
20 changes: 10 additions & 10 deletions nextcloud/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ services:
interval: 15s
start_period: 30s

redis:
hostname: redis
image: redis:${REDIS_VERSION:?}
valkey:
hostname: valkey
image: valkey/valkey:${VALKEY_VERSION:?}
restart: unless-stopped

command: |-
sh -c 'exec redis-server --requirepass "$${REDIS_HOST_PASSWORD}"'
sh -c 'exec valkey-server --requirepass "$${REDIS_HOST_PASSWORD}"'
security_opt:
# NOTE: Do NOT add a [space] before `true` below.
Expand All @@ -54,15 +54,15 @@ services:
networks:
- default
volumes:
- ./data/redis/data:/data:rw
- ./data/valkey/data:/data:rw

env_file:
- env/redis
- env/valkey
environment:
TZ: ${TZ:?}

healthcheck:
test: "redis-cli ping"
test: '[ $$(valkey-cli --pass "$${REDIS_HOST_PASSWORD}" ping) = ''PONG'' ]'
interval: 5s
start_period: 10s

Expand Down Expand Up @@ -141,7 +141,7 @@ services:
depends_on:
mariadb:
condition: service_healthy
redis:
valkey:
condition: service_healthy
fulltextsearch:
condition: service_healthy
Expand All @@ -164,7 +164,7 @@ services:

env_file:
- env/mariadb
- env/redis
- env/valkey
- env/nextcloud
environment:
TZ: ${TZ:?}
Expand Down Expand Up @@ -202,7 +202,7 @@ services:

env_file:
- env/mariadb
- env/redis
- env/valkey
- env/nextcloud
environment:
TZ: ${TZ:?}
Expand Down
3 changes: 2 additions & 1 deletion nextcloud/env/nextcloud
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MYSQL_HOST: 'mariadb'
REDIS_HOST: 'redis'
# FIXME: Nextcloud config scripts use this env var name.
REDIS_HOST: 'valkey'
# FIXME: See https://github.com/nextcloud/docker/issues/1494
#APACHE_DISABLE_REWRITE_IP: 1
NEXTCLOUD_DATA_DIR: '/data'
Expand Down
1 change: 0 additions & 1 deletion nextcloud/env/redis

This file was deleted.

2 changes: 2 additions & 0 deletions nextcloud/env/valkey
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# FIXME: Nextcloud config scripts use this env var name.
REDIS_HOST_PASSWORD: 'nextcloud_password'
2 changes: 0 additions & 2 deletions nextcloud/static.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ NEXTCLOUD_FULL_TEXT_SEARCH_VERSION=20241216_102930
NEXTCLOUD_IMAGINARY_VERSION=20250114_092611
NEXTCLOUD_VERSION=30.0.5-core
NEXTCLOUD_BASE_PATH=nextcloud

REDIS_VERSION=7.4.2

0 comments on commit 8e7f3b6

Please sign in to comment.