mirror of
https://git.tt-rss.org/fox/ttrss-docker-compose
synced 2025-06-14 22:39:53 +02:00
Merge branch 'static-dockerhub' of git.tt-rss.org:fox/ttrss-docker-compose into static-dockerhub
This commit is contained in:
commit
aec490eea1
10 changed files with 97 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
|||
FROM alpine:3.9
|
||||
FROM alpine:3.12
|
||||
EXPOSE 9000/tcp
|
||||
|
||||
RUN apk add --no-cache php7 php7-fpm \
|
||||
RUN apk add --no-cache dcron php7 php7-fpm \
|
||||
php7-pdo php7-gd php7-pgsql php7-pdo_pgsql php7-mbstring \
|
||||
php7-intl php7-xml php7-curl php7-session \
|
||||
php7-dom php7-fileinfo php7-json \
|
||||
|
@ -12,8 +12,11 @@ ADD startup.sh /
|
|||
ADD updater.sh /
|
||||
ADD index.php /
|
||||
ADD build-prepare.sh /
|
||||
ADD dcron.sh /
|
||||
ADD backup.sh /etc/periodic/weekly/backup
|
||||
|
||||
RUN sed -i.bak 's/^listen = 127.0.0.1:9000/listen = 9000/' /etc/php7/php-fpm.d/www.conf
|
||||
RUN sed -i.bak 's/\(memory_limit =\) 128M/\1 256M/' /etc/php7/php.ini
|
||||
|
||||
RUN sh -c /build-prepare.sh
|
||||
|
||||
|
|
31
src/app/backup.sh
Executable file
31
src/app/backup.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
DST_DIR=/backups
|
||||
KEEP_DAYS=28
|
||||
APP_ROOT=/var/www/html/tt-rss
|
||||
|
||||
if pg_isready -h $DB_HOST -U $DB_USER; then
|
||||
DST_FILE=ttrss-backup-$(date +%Y%m%d).sql.gz
|
||||
|
||||
echo backing up tt-rss database to $DST_DIR/$DST_FILE...
|
||||
|
||||
export PGPASSWORD=$DB_PASS
|
||||
|
||||
pg_dump --clean -h $DB_HOST -U $DB_USER $DB_NAME | gzip > $DST_DIR/$DST_FILE
|
||||
|
||||
DST_FILE=ttrss-backup-$(date +%Y%m%d).tar.gz
|
||||
|
||||
echo backing up tt-rss local directories to $DST_DIR/$DST_FILE...
|
||||
|
||||
tar -cz -f $DST_DIR/$DST_FILE $APP_ROOT/*.local \
|
||||
$APP_ROOT/feed-icons/ \
|
||||
$APP_ROOT/config.php
|
||||
|
||||
echo cleaning up...
|
||||
|
||||
find $DST_DIR -type f -name '*.gz' -mtime +$KEEP_DAYS -delete
|
||||
|
||||
echo done.
|
||||
else
|
||||
echo backup failed: database is not ready.
|
||||
fi
|
5
src/app/dcron.sh
Executable file
5
src/app/dcron.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
# https://github.com/dubiousjim/dcron/issues/13
|
||||
set -e
|
||||
|
||||
/usr/sbin/crond "$@"
|
|
@ -42,7 +42,8 @@ for d in cache lock feed-icons plugins.local themes.local; do
|
|||
done
|
||||
|
||||
for d in cache lock feed-icons; do
|
||||
chmod -R 777 $DST_DIR/$d
|
||||
chmod 777 $DST_DIR/$d
|
||||
find $DST_DIR/$d -type f -exec chmod 666 {} \;
|
||||
done
|
||||
|
||||
chown -R $OWNER_UID:$OWNER_GID $DST_DIR \
|
||||
|
@ -83,6 +84,8 @@ else
|
|||
-i $DST_DIR/config.php
|
||||
fi
|
||||
|
||||
cd $DST_DIR && sudo -u app php ./update.php --update-schema=force-yes
|
||||
|
||||
touch $DST_DIR/.app_is_ready
|
||||
|
||||
sudo -u app /usr/sbin/php-fpm7 -F
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue