Repository with my Nextcloud php-fpm's Dockerfile
6.2K
ā Warning: This image is a PHP-FPM container and does not include Nextcloud or a web server.
- Nextcloud must be mounted separately via a Docker volume to allow web updates.
- A web server like Apacheā is required to serve Nextcloud.
php:8.4-fpm). Uses Debian with GLibC for Recognizeā in native speed mode.nextcloud:fpm) and LinuxServer.ioā .Use s6-overlayā for:
preview:pre-generate cron job every 10 minutes if Preview Generatorā is present.NC_EXT_UPDATE is defined.HEALTHCHECKS_NC_URL.HEALTHCHECKS_PREVIEW_URL.HEALTHCHECKS_UPDATE_URL.Includes Full Text Searchā support:
occ fulltextsearch:live for automatic indexing of new content (only if Full Text Search is present).python3-venv (for LLMā support).php-cli.ini for CLI scripts.You can use PUID / GUID to use a non root user specific instead of the www-data's PID 82. For that, just set environment variables:
environment:
PUID: 'NEXTCLOUD_PUID'
PGID: 'NEXTCLOUD_PGID'
You can include your own PHP (/usr/local/etc/php/conf.d) and PHP-FPM (/usr/local/etc/php-fpm.d/) configuration files:
/custom-php-conf-init.d/custom-php-fpm-conf-init.dš See the exampleā .
You can execute custom scripts at container initialization, for example, to install additional software or modify configurations. Just put it in /custom-script-init.d
š See the exampleā .
To run the container using the Docker CLI:
docker run -d \
-v /docker/volumes/www:/var/www \
--expose 9000 \
llaumgui/php:8.4-nextcloud
| Variable | Description | Default Value |
|---|---|---|
TZ | Timezone configuration | |
HEALTHCHECKS_NC_URL | Healthcheck URL for Nextcloud cron job | false |
HEALTHCHECKS_PREVIEW_URL | Healthcheck URL for Preview Generator job | false |
HEALTHCHECKS_UPDATE_URL | Healthcheck URL for automatic updates | false |
NC_EXT_UPDATE | Enable automatic extension updates (true/false) | false |
PUID | User ID for the httpd process (www-data). | 33 |
PGID | Group ID for the httpd process (www-data). | 33 |
ā Warning: Replace
NEXTCLOUD_DOMAIN,HEALTHCHECKS_DOMAINandNEXTCLOUD_PUID/NEXTCLOUD_PGID.
You can use this container in a docker-compose.yml file:
# Services definition part
services:
## httpd
httpd:
container_name: nextcloud_httpd
hostname: nextcloud-httpd
image: ghcr.io/llaumgui/httpd:2.4
restart: unless-stopped
environment:
TZ: 'Europe/Paris'
PUID: 'NEXTCLOUD_PUID'
PGID: 'NEXTCLOUD_PGID'
volumes:
- /srv/nextcloud/www:/var/www
- /srv/nextcloud/apache/vhost.d:/usr/local/apache2/conf/vhost.d
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 http://localhost:80/status.php -q -O /dev/null || exit 1"]
depends_on:
- php
expose:
- 80
## PHP
php:
container_name: nextcloud_php
hostname: nextcloud-php
image: ghcr.io/llaumgui/php:8.4-nextcloud-fpm
restart: unless-stopped
environment:
TZ: 'Europe/Paris'
PUID: 'NEXTCLOUD_PUID'
PGID: 'NEXTCLOUD_PGID'
volumes:
- type: tmpfs
target: /tmp:exec
- /srv/nextcloud/data:/nextcloud/data
- /srv/nextcloud/logs:/nextcloud/logs
- /srv/nextcloud/www:/var/www
- /srv/storage:/srv/storage
expose:
- 9000
You can also use with Traefikā , PostgreSQLā , and Collaboraā :
# Services definition part
services:
## httpd
httpd:
container_name: nextcloud_httpd
hostname: nextcloud-httpd
image: ghcr.io/llaumgui/httpd:2.4
restart: unless-stopped
environment:
TZ: 'Europe/Paris'
PUID: 'NEXTCLOUD_PUID'
PGID: 'NEXTCLOUD_PGID'
HEALTHCHECKS_NC_URL: 'https://HEALTHCHECKS_DOMAIN/ping/xxx'
HEALTHCHECKS_UPDATE_URL: 'https://HEALTHCHECKS_DOMAIN/ping/xxx'
HEALTHCHECKS_PREVIEW_URL: 'https://HEALTHCHECKS_DOMAIN/ping/xxx'
NC_EXT_UPDATE: 'true'
labels:
- traefik.enable=true
- traefik.http.routers.nextcloud.entrypoints=web
- traefik.http.routers.nextcloud.rule=Host("NEXTCLOUD_DOMAIN")
- traefik.http.routers.nextcloud.tls.certresolver=letsencrypt
- traefik.http.routers.nextcloud.middlewares=redirectregex_nextcloud1,redirectregex_nextcloud2
- traefik.http.middlewares.redirectregex_nextcloud1.redirectregex.permanent=true
- traefik.http.middlewares.redirectregex_nextcloud1.redirectregex.regex=https?://([^/]*)/.well-known/(card|cal)dav
- traefik.http.middlewares.redirectregex_nextcloud1.redirectregex.replacement=https://$${1}/remote.php/dav/
- traefik.http.middlewares.redirectregex_nextcloud2.redirectregex.permanent=true
- traefik.http.middlewares.redirectregex_nextcloud2.redirectregex.regex=https?://([^/]*)(/.well-known[^#]*)
- traefik.http.middlewares.redirectregex_nextcloud2.redirectregex.replacement=https://$${1}/index.php$${2}
volumes:
- /srv/nextcloud/www:/var/www
- /srv/nextcloud/apache/vhost.d:/usr/local/apache2/conf/vhost.d
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 http://localhost:80/status.php -q -O /dev/null || exit 1"]
depends_on:
- php
expose:
- 80
## PHP
php:
container_name: nextcloud_php
hostname: nextcloud-php
image: ghcr.io/llaumgui/php:8.4-nextcloud-fpm
restart: unless-stopped
environment:
TZ: 'Europe/Paris'
PUID: 'NEXTCLOUD_PUID'
PGID: 'NEXTCLOUD_PGID'
volumes:
- type: tmpfs
target: /tmp:exec
- /srv/nextcloud/data:/nextcloud/data
- /srv/nextcloud/logs:/nextcloud/logs
- /srv/nextcloud/www:/var/www
- /srv/storage:/srv/storage
depends_on:
- collabora
expose:
- 9000
## Postgres
postgres:
container_name: storage_postgres
hostname: storage-postgres
image: postgres:17
restart: unless-stopped
user: NEXTCLOUD_PUID:123
environment:
TZ: 'Europe/Paris'
volumes:
- /srv/postgresql:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "miniflux"]
ports:
- "127.0.0.1:5432:5432"
## Collabora
collabora:
container_name: nextcloud_collabora
hostname: nextcloud-collabora
image: collabora/code
restart: unless-stopped
environment:
TZ: 'Europe/Paris'
dictionaries: 'fr_FR'
server_name: 'office.NEXTCLOUD_DOMAIN'
aliasgroup1: 'https://NEXTCLOUD_DOMAIN'
extra_params: '--o:ssl.enable=false --o:ssl.termination=true --o:net.proto=IPv4'
username: 'johndo'
password: 'azerty'
labels:
- traefik.enable=true
- traefik.http.routers.collabora.entrypoints=web
- traefik.http.routers.collabora.rule=Host("office.NEXTCLOUD_DOMAIN")
- traefik.http.routers.collabora.tls.certresolver=letsencrypt
- traefik.http.routers.collabora.service=collabora
- traefik.http.services.collabora.loadbalancer.server.port=9980
cap_add:
- MKNOD
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9980 | grep OK || exit 1"]
interval: 1m
start_period: 2m
alias occ="docker exec -u NEXTCLOUD_PUID -i nextcloud_php php /var/www/occ"
Content type
Image
Digest
sha256:836adeab5ā¦
Size
1021.5 MB
Last updated
6 days ago
docker pull llaumgui/nextcloud-php