Nextcloud (fpm-alpine) with user modifications (push, inotify, UID/GID changes)
10K+
The official nextcloud-fpm-alpine image user www-data defaults to UID:82 and GID:82.
This image adjusts the defaults to more suitable UID:GID values of 1000:1001.
This enables sharing files with other docker services and containers without getting into file permission conflicts.
Since v3.0.0 the UID and GID of www-data can be changed at container start, without rebuilding the image:
docker cli:
docker run -d --name nextcloud-app \
-e PUID=500 \
-e PGID=500 \
verypacific/nextcloud:<tag>
docker compose:
services:
nextcloud-app:
image: verypacific/nextcloud:<tag>
environment:
- PUID=500
- PGID=500
1000:1001). Setting only one of them changes only that ID./var/www/html, data directory, external storage) are never changed. When switching the IDs of an existing installation, re-own the persistent data on the host yourself (container stopped), e.g. find <path> -uid <old> -gid <old> -exec chown -h <new>:<new> {} +. Do not use a blanket chown -R on folders that also hold database or cache data.user: / --user set, the remap is skipped.PUID=0 / PGID=0 are rejected.To enable watch of external share changes in nextcloud inotify and the php-extension have been added.
The image starts supervisord with /supervisord.conf (php-fpm and cron, based on the official Nextcloud example). This file includes all *.ini files from /etc/supervisor.d/, the drop-in directory of Alpine's supervisor package.
The watcher for external storages ships as the drop-in /etc/supervisor.d/watch-external.ini. By default it watches the external storages with IDs 1 and 2. This helps detect and sync changes made outside Nextcloud, e.g. to paperless-ngx consume and document folders.
To get the IDs of your external storages:
docker exec --user www-data nextcloud-app php occ files_external:list
Copy the drop-in from the image tag you run, edit it (e.g. numprocs) and bind-mount it over the bundled one:
docker run --rm --entrypoint cat verypacific/nextcloud:<tag> /etc/supervisor.d/watch-external.ini > watch-external.ini
# edit watch-external.ini, e.g. numprocs=3
docker cli:
docker run -d --name nextcloud-app \
-v /path/to/watch-external.ini:/etc/supervisor.d/watch-external.ini:ro \
verypacific/nextcloud:<tag>
docker compose:
services:
nextcloud-app:
image: verypacific/nextcloud:<tag>
volumes:
- /path/to/watch-external.ini:/etc/supervisor.d/watch-external.ini:ro
Bind-mount additional *.ini files into /etc/supervisor.d/, e.g. -v /path/to/my-job.ini:/etc/supervisor.d/my-job.ini:ro.
user=www-data for anything that touches Nextcloud files or runs occ.[program:php-fpm], [program:cron], [program:watch_external]) silently replaces the bundled program.If you do not use external storages, disable the watcher by mounting an empty file over the drop-in. Otherwise it retries for about 30 minutes and then gives up, filling the log with errors.
-v /dev/null:/etc/supervisor.d/watch-external.ini:ro
docker restart nextcloud-app.docker logs nextcloud-app after changes.watch-external.ini of the new tag, as improvements to the bundled file are not applied to your copy.numprocs watches consecutive IDs starting at numprocs_start. For non-consecutive IDs add a separate [program:...] section per ID./supervisord.conf itself should not be replaced. Use drop-ins instead, so that changes to php-fpm and cron in future images still apply.Setup follows official instructions icewind1991/files_inotify See as well How to automatically detect new files in external storage
Tags follow those of the official Nextcloud images. Image updates get released as soon as a new official Nextcloud images becomes available time permitting.
Content type
Image
Digest
sha256:9b2b5c7af…
Size
419.5 MB
Last updated
3 days ago
docker pull verypacific/nextcloud