mirror of
https://github.com/CoolnsX/selfhost_podman.git
synced 2025-12-20 20:05:17 +05:30
feat: custom entrypoint to run before the official entrypoint in nextcloud container
This commit is contained in:
22
nextcloud/nextcloud-entrypoint.sh
Executable file
22
nextcloud/nextcloud-entrypoint.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
####################
|
||||
# My Special Sauce #
|
||||
####################
|
||||
|
||||
#################################################################
|
||||
# This script is to make the www-data in /entrypoint.sh to #
|
||||
# any user specified by $UID, so that your nextcloud can run #
|
||||
# properly. #
|
||||
#################################################################
|
||||
|
||||
set -eu
|
||||
|
||||
# default to UID=1000 if not set
|
||||
TARGET_UID="${UID:-1000}"
|
||||
|
||||
# replace "www-data" with numeric UID/GID
|
||||
sed -i "s/www-data/${TARGET_UID}/g" /entrypoint.sh
|
||||
|
||||
# execute the patched entrypoint with all args
|
||||
exec /entrypoint.sh php-fpm
|
||||
@@ -19,7 +19,7 @@ php occ app:install notify_push || true
|
||||
php occ app:enable notify_push || true
|
||||
|
||||
echo "[*] Starting notify_push binary..."
|
||||
/var/www/html/apps/notify_push/bin/x86_64/notify_push &
|
||||
/var/www/html/custom_apps/notify_push/bin/x86_64/notify_push &
|
||||
NOTIFY_PID=$!
|
||||
|
||||
# Wait for the socket to appear, max 30 seconds
|
||||
|
||||
@@ -3,14 +3,11 @@ Description=Nextcloud Container
|
||||
Requires=nextcloud_db.service nextcloud_valkey.service
|
||||
After=nextcloud_db.service nextcloud_valkey.service
|
||||
|
||||
AssertPathIsDirectory=%h/podman/nextcloud
|
||||
AssertPathIsDirectory=%h/podman/nextcloud/html
|
||||
AssertPathIsDirectory=%h/nextcloud
|
||||
|
||||
[Container]
|
||||
Pod=nextcloud.pod
|
||||
ContainerName=nextcloud
|
||||
Image=docker.io/library/nextcloud:fpm-alpine
|
||||
Entrypoint=/nextcloud-entrypoint.sh
|
||||
|
||||
# Enable auto-update container
|
||||
AutoUpdate=registry
|
||||
@@ -28,6 +25,7 @@ Volume=%h/podman/nextcloud/html:/var/www/html
|
||||
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=./nextcloud-entrypoint.sh:/nextcloud-entrypoint.sh
|
||||
|
||||
[Service]
|
||||
# pass this to autofill above variables
|
||||
|
||||
Reference in New Issue
Block a user