summaryrefslogtreecommitdiff
path: root/.docker/app/updater.sh
diff options
context:
space:
mode:
Diffstat (limited to '.docker/app/updater.sh')
-rw-r--r--.docker/app/updater.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/.docker/app/updater.sh b/.docker/app/updater.sh
new file mode 100644
index 000000000..219041a59
--- /dev/null
+++ b/.docker/app/updater.sh
@@ -0,0 +1,33 @@
+#!/bin/sh -e
+
+# We don't need those here (HTTP_HOST would cause false SELF_URL_PATH check failures)
+unset HTTP_PORT
+unset HTTP_HOST
+
+unset ADMIN_USER_PASS
+unset AUTO_CREATE_USER_PASS
+
+# wait for the app container to delete .app_is_ready and perform rsync, etc.
+sleep 30
+
+if ! id app; then
+ addgroup -g $OWNER_GID app
+ adduser -D -h /var/www/html -G app -u $OWNER_UID app
+fi
+
+while ! pg_isready -h $TTRSS_DB_HOST -U $TTRSS_DB_USER; do
+ echo waiting until $TTRSS_DB_HOST is ready...
+ sleep 3
+done
+
+sed -i.bak "s/^\(memory_limit\) = \(.*\)/\1 = ${PHP_WORKER_MEMORY_LIMIT}/" \
+ /etc/php81/php.ini
+
+DST_DIR=/var/www/html/tt-rss
+
+while [ ! -s $DST_DIR/config.php -a -e $DST_DIR/.app_is_ready ]; do
+ echo waiting for app container...
+ sleep 3
+done
+
+sudo -E -u app /usr/bin/php81 /var/www/html/tt-rss/update_daemon2.php