mirror of
https://github.com/CoolnsX/selfhost_podman.git
synced 2025-12-20 11:55:16 +05:30
feat: revert to custom entrypoint file
This commit is contained in:
48
nextcloud/nextcloud-entrypoint.sh
Executable file
48
nextcloud/nextcloud-entrypoint.sh
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
####################
|
||||||
|
# My Special Sauce #
|
||||||
|
####################
|
||||||
|
#################################################################
|
||||||
|
# This script is to make the www-data in /entrypoint.sh to #
|
||||||
|
# any user specified by $PUID environment variable, #
|
||||||
|
# so that your nextcloud can run or update properly. #
|
||||||
|
#################################################################
|
||||||
|
|
||||||
|
# default to UID=1000 if not set
|
||||||
|
TARGET_UID="${PUID:-1000}"
|
||||||
|
|
||||||
|
# Overwrite /usr/local/etc/php-fpm.d/zz-docker.conf to make php-fpm listen on unix socket
|
||||||
|
cat << EOF > /usr/local/etc/php-fpm.d/zz-docker.conf
|
||||||
|
; Generated by /nextcloud-entrypoint.sh
|
||||||
|
; DO NOT EDIT THIS FILE, IT WILL BE OVERWRITTEN !!
|
||||||
|
; please make changes in the /nextcloud-entrypoint.sh script
|
||||||
|
[global]
|
||||||
|
daemonize = no
|
||||||
|
|
||||||
|
[www]
|
||||||
|
access.log = /tmp/fpm-access.log
|
||||||
|
listen = ${NEXTCLOUD_FPM_SOCK:-/tmp/docker/nextcloud-fpm.sock}
|
||||||
|
|
||||||
|
listen.owner = ${TARGET_UID}
|
||||||
|
listen.group = ${TARGET_UID}
|
||||||
|
; Restricting socket to owner and group only
|
||||||
|
listen.mode = 0660
|
||||||
|
|
||||||
|
user = ${TARGET_UID}
|
||||||
|
group = ${TARGET_UID}
|
||||||
|
|
||||||
|
pm.max_children = 50
|
||||||
|
pm.start_servers = 10
|
||||||
|
pm.min_spare_servers = 5
|
||||||
|
pm.max_spare_servers = 15
|
||||||
|
pm.max_requests = 1000
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# replace "www-data" with numeric $PUID in /entrypoint.sh
|
||||||
|
sed -i "s/www-data/${TARGET_UID}/g" /entrypoint.sh
|
||||||
|
|
||||||
|
# execute the patched entrypoint with all args
|
||||||
|
exec /entrypoint.sh php-fpm
|
||||||
@@ -7,7 +7,7 @@ After=nextcloud_db.service nextcloud_valkey.service
|
|||||||
Pod=nextcloud.pod
|
Pod=nextcloud.pod
|
||||||
ContainerName=nextcloud
|
ContainerName=nextcloud
|
||||||
Image=docker.io/library/nextcloud:fpm-alpine
|
Image=docker.io/library/nextcloud:fpm-alpine
|
||||||
Entrypoint=["/bin/sh","-c","sed -i 's/www-data/1000/g' /entrypoint.sh && exec /entrypoint.sh php-fpm"]
|
Entrypoint=/nextcloud-entrypoint.sh
|
||||||
|
|
||||||
# Enable auto-update container
|
# Enable auto-update container
|
||||||
AutoUpdate=registry
|
AutoUpdate=registry
|
||||||
@@ -23,7 +23,6 @@ EnvironmentFile=./.env
|
|||||||
|
|
||||||
Volume=%h/podman/nextcloud/html:/var/www/html
|
Volume=%h/podman/nextcloud/html:/var/www/html
|
||||||
Volume=%h/nextcloud:/var/www/html/data
|
Volume=%h/nextcloud:/var/www/html/data
|
||||||
Volume=./zz-docker.conf:/usr/local/etc/php-fpm.d/zz-docker.conf
|
|
||||||
Volume=${EXTERNAL_DIR}:${EXTERNAL_DIR}
|
Volume=${EXTERNAL_DIR}:${EXTERNAL_DIR}
|
||||||
Volume=./nextcloud-entrypoint.sh:/nextcloud-entrypoint.sh
|
Volume=./nextcloud-entrypoint.sh:/nextcloud-entrypoint.sh
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
[global]
|
|
||||||
daemonize = no
|
|
||||||
|
|
||||||
[www]
|
|
||||||
access.log = /tmp/fpm-access.log
|
|
||||||
listen = /tmp/docker/nextcloud-fpm.sock
|
|
||||||
|
|
||||||
listen.owner = 1000
|
|
||||||
listen.group = 1000
|
|
||||||
listen.mode = 0777
|
|
||||||
|
|
||||||
user = 1000
|
|
||||||
group = 1000
|
|
||||||
|
|
||||||
pm.max_children = 50
|
|
||||||
pm.start_servers = 10
|
|
||||||
pm.min_spare_servers = 5
|
|
||||||
pm.max_spare_servers = 15
|
|
||||||
pm.max_requests = 1000
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user