mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
Merge pull request #2703 from nextcloud/enh/2695/notify-push
put notify-push into its own container
This commit is contained in:
commit
541fad9bab
6 changed files with 98 additions and 22 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
# Notify Push
|
# Notify Push
|
||||||
route /push/* {
|
route /push/* {
|
||||||
uri strip_prefix /push
|
uri strip_prefix /push
|
||||||
reverse_proxy {$NEXTCLOUD_HOST}:7867
|
reverse_proxy {$NOTIFY_PUSH_HOST}:7867
|
||||||
}
|
}
|
||||||
|
|
||||||
# Onlyoffice
|
# Onlyoffice
|
||||||
|
|
|
||||||
|
|
@ -131,14 +131,4 @@ if ! sudo -E -u www-data bash /entrypoint.sh; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Correctly set CPU_ARCH for notify_push
|
|
||||||
CPU_ARCH="$(uname -m)"
|
|
||||||
export CPU_ARCH
|
|
||||||
if [ -z "$CPU_ARCH" ]; then
|
|
||||||
echo "Could not get processor architecture. Exiting."
|
|
||||||
exit 1
|
|
||||||
elif [ "$CPU_ARCH" != "x86_64" ]; then
|
|
||||||
export CPU_ARCH="aarch64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
@ -25,14 +25,6 @@ stderr_logfile_maxbytes=0
|
||||||
command=/cron.sh
|
command=/cron.sh
|
||||||
user=www-data
|
user=www-data
|
||||||
|
|
||||||
[program:notify-push]
|
|
||||||
stdout_logfile=/dev/stdout
|
|
||||||
stdout_logfile_maxbytes=0
|
|
||||||
stderr_logfile=/dev/stderr
|
|
||||||
stderr_logfile_maxbytes=0
|
|
||||||
command=/var/www/html/custom_apps/notify_push/bin/%(ENV_CPU_ARCH)s/notify_push /var/www/html/config/config.php --port 7867 --redis-url redis://:%(ENV_REDIS_HOST_PASSWORD)s@%(ENV_REDIS_HOST)s
|
|
||||||
user=www-data
|
|
||||||
|
|
||||||
[program:run-exec-commands]
|
[program:run-exec-commands]
|
||||||
stdout_logfile=/dev/stdout
|
stdout_logfile=/dev/stdout
|
||||||
stdout_logfile_maxbytes=0
|
stdout_logfile_maxbytes=0
|
||||||
|
|
|
||||||
20
Containers/notify-push/Dockerfile
Normal file
20
Containers/notify-push/Dockerfile
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
FROM alpine:3.18.2
|
||||||
|
|
||||||
|
COPY --chmod=775 start.sh /start.sh
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
apk add --no-cache \
|
||||||
|
ca-certificates \
|
||||||
|
tzdata \
|
||||||
|
bash \
|
||||||
|
openssl; \
|
||||||
|
# Give root a random password
|
||||||
|
echo "root:$(openssl rand -base64 12)" | chpasswd; \
|
||||||
|
apk del --no-cache \
|
||||||
|
openssl;
|
||||||
|
|
||||||
|
USER 33
|
||||||
|
ENTRYPOINT ["/start.sh"]
|
||||||
|
|
||||||
|
HEALTHCHECK CMD nc -z localhost 7867 || exit 1
|
||||||
|
LABEL com.centurylinklabs.watchtower.monitor-only="true"
|
||||||
38
Containers/notify-push/start.sh
Normal file
38
Containers/notify-push/start.sh
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$NEXTCLOUD_HOST" ]; then
|
||||||
|
echo "NEXTCLOUD_HOST need to be provided. Exiting!"
|
||||||
|
exit 1
|
||||||
|
elif [ -z "$POSTGRES_HOST" ]; then
|
||||||
|
echo "POSTGRES_HOST need to be provided. Exiting!"
|
||||||
|
exit 1
|
||||||
|
elif [ -z "$REDIS_HOST" ]; then
|
||||||
|
echo "REDIS_HOST need to be provided. Exiting!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Only start container if nextcloud is accessible
|
||||||
|
while ! nc -z "$NEXTCLOUD_HOST" 9000; do
|
||||||
|
echo "Waiting for Nextcloud to start..."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
|
# Correctly set CPU_ARCH for notify_push
|
||||||
|
CPU_ARCH="$(uname -m)"
|
||||||
|
export CPU_ARCH
|
||||||
|
if [ -z "$CPU_ARCH" ]; then
|
||||||
|
echo "Could not get processor architecture. Exiting."
|
||||||
|
exit 1
|
||||||
|
elif [ "$CPU_ARCH" != "x86_64" ]; then
|
||||||
|
export CPU_ARCH="aarch64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run it
|
||||||
|
/nextcloud/custom_apps/notify_push/bin/"$CPU_ARCH"/notify_push \
|
||||||
|
--database-prefix="oc_" \
|
||||||
|
--nextcloud-url "https://$NC_DOMAIN" \
|
||||||
|
--port 7867 \
|
||||||
|
--redis-url "redis://:$REDIS_HOST_PASSWORD@$REDIS_HOST" \
|
||||||
|
--database-url "postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB"
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
"nextcloud-aio-onlyoffice",
|
"nextcloud-aio-onlyoffice",
|
||||||
"nextcloud-aio-collabora",
|
"nextcloud-aio-collabora",
|
||||||
"nextcloud-aio-talk",
|
"nextcloud-aio-talk",
|
||||||
|
"nextcloud-aio-notify-push",
|
||||||
"nextcloud-aio-nextcloud"
|
"nextcloud-aio-nextcloud"
|
||||||
],
|
],
|
||||||
"display_name": "Apache",
|
"display_name": "Apache",
|
||||||
|
|
@ -27,7 +28,8 @@
|
||||||
"ONLYOFFICE_HOST=nextcloud-aio-onlyoffice",
|
"ONLYOFFICE_HOST=nextcloud-aio-onlyoffice",
|
||||||
"TZ=%TIMEZONE%",
|
"TZ=%TIMEZONE%",
|
||||||
"APACHE_MAX_SIZE=%APACHE_MAX_SIZE%",
|
"APACHE_MAX_SIZE=%APACHE_MAX_SIZE%",
|
||||||
"APACHE_MAX_TIME=%NEXTCLOUD_MAX_TIME%"
|
"APACHE_MAX_TIME=%NEXTCLOUD_MAX_TIME%",
|
||||||
|
"NOTIFY_PUSH_HOST=nextcloud-aio-notify-push"
|
||||||
],
|
],
|
||||||
"volumes": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
|
|
@ -104,8 +106,7 @@
|
||||||
"display_name": "Nextcloud",
|
"display_name": "Nextcloud",
|
||||||
"image": "nextcloud/aio-nextcloud",
|
"image": "nextcloud/aio-nextcloud",
|
||||||
"expose": [
|
"expose": [
|
||||||
"9000",
|
"9000"
|
||||||
"7867"
|
|
||||||
],
|
],
|
||||||
"internal_port": "9000",
|
"internal_port": "9000",
|
||||||
"secrets": [
|
"secrets": [
|
||||||
|
|
@ -193,6 +194,41 @@
|
||||||
"nextcloud-aio"
|
"nextcloud-aio"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"container_name": "nextcloud-aio-notify-push",
|
||||||
|
"display_name": "Notify Push",
|
||||||
|
"image": "nextcloud/aio-notify-push",
|
||||||
|
"expose": [
|
||||||
|
"7867"
|
||||||
|
],
|
||||||
|
"internal_port": "7876",
|
||||||
|
"secrets": [
|
||||||
|
"REDIS_PASSWORD",
|
||||||
|
"POSTGRES_PASSWORD"
|
||||||
|
],
|
||||||
|
"volumes": [
|
||||||
|
{
|
||||||
|
"source": "nextcloud_aio_nextcloud",
|
||||||
|
"destination": "/nextcloud",
|
||||||
|
"writeable": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"environment": [
|
||||||
|
"NC_DOMAIN=%NC_DOMAIN%",
|
||||||
|
"NEXTCLOUD_HOST=nextcloud-aio-nextcloud",
|
||||||
|
"REDIS_HOST=nextcloud-aio-redis",
|
||||||
|
"REDIS_HOST_PASSWORD=%REDIS_PASSWORD%",
|
||||||
|
"POSTGRES_HOST=nextcloud-aio-database",
|
||||||
|
"POSTGRES_PASSWORD=%DATABASE_PASSWORD%",
|
||||||
|
"POSTGRES_DB=nextcloud_database",
|
||||||
|
"POSTGRES_USER=nextcloud"
|
||||||
|
],
|
||||||
|
"restart": "unless-stopped",
|
||||||
|
"networks": [
|
||||||
|
"nextcloud-aio"
|
||||||
|
],
|
||||||
|
"read_only": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"container_name": "nextcloud-aio-redis",
|
"container_name": "nextcloud-aio-redis",
|
||||||
"display_name": "Redis",
|
"display_name": "Redis",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue