remove unused things from this branch build directory
parent
81f6de6e6b
commit
e43e239e34
@ -1,23 +0,0 @@
|
||||
FROM alpine:3.12
|
||||
EXPOSE 9000/tcp
|
||||
|
||||
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 \
|
||||
php7-pcntl php7-posix php7-zip php7-openssl \
|
||||
git postgresql-client sudo rsync
|
||||
|
||||
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
|
||||
|
||||
CMD /startup.sh
|
@ -1,31 +0,0 @@
|
||||
#!/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
|
@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
DST_DIR=/src/tt-rss
|
||||
|
||||
mkdir -p $DST_DIR
|
||||
|
||||
git clone --branch master --depth 1 https://git.tt-rss.org/fox/tt-rss.git $DST_DIR
|
||||
git clone --branch master --depth 1 https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git $DST_DIR/plugins.local/nginx_xaccel
|
||||
|
||||
mkdir -p /var/www
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
# https://github.com/dubiousjim/dcron/issues/13
|
||||
set -e
|
||||
|
||||
/usr/sbin/crond "$@"
|
@ -1,3 +0,0 @@
|
||||
<?php
|
||||
header("Location: /tt-rss/");
|
||||
return;
|
@ -1,92 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
while ! pg_isready -h $DB_HOST -U $DB_USER; do
|
||||
echo waiting until $DB_HOST is ready...
|
||||
sleep 3
|
||||
done
|
||||
|
||||
if ! id app; then
|
||||
addgroup -g $OWNER_GID app
|
||||
adduser -D -h /var/www/html -G app -u $OWNER_UID app
|
||||
fi
|
||||
|
||||
DST_DIR=/var/www/html/tt-rss
|
||||
SRC_DIR=/src/tt-rss/
|
||||
|
||||
[ -e $DST_DIR ] && rm -f $DST_DIR/.app_is_ready
|
||||
|
||||
export PGPASSWORD=$DB_PASS
|
||||
|
||||
[ ! -e /var/www/html/index.php ] && cp /index.php /var/www/html
|
||||
|
||||
if [ ! -d $DST_DIR ]; then
|
||||
rsync -aP \
|
||||
$SRC_DIR/ $DST_DIR/
|
||||
else
|
||||
rsync -aP --delete \
|
||||
--exclude cache \
|
||||
--exclude lock \
|
||||
--exclude feed-icons \
|
||||
--exclude plugins.local \
|
||||
--exclude templates.local \
|
||||
--exclude themes.local \
|
||||
--exclude config.php \
|
||||
$SRC_DIR/ $DST_DIR/
|
||||
|
||||
rsync -aP --delete \
|
||||
$SRC_DIR/plugins.local/nginx_xaccel $DST_DIR/plugins.local/nginx_xaccel
|
||||
fi
|
||||
|
||||
for d in cache lock feed-icons plugins.local themes.local; do
|
||||
mkdir -p $DST_DIR/$d
|
||||
done
|
||||
|
||||
for d in cache lock feed-icons; do
|
||||
chmod 777 $DST_DIR/$d
|
||||
find $DST_DIR/$d -type f -exec chmod 666 {} \;
|
||||
done
|
||||
|
||||
chown -R $OWNER_UID:$OWNER_GID $DST_DIR \
|
||||
/var/log/php7
|
||||
|
||||
PSQL="psql -q -h $DB_HOST -U $DB_USER $DB_NAME"
|
||||
|
||||
$PSQL -c "create extension if not exists pg_trgm"
|
||||
|
||||
RESTORE_SCHEMA=/var/www/html/tt-rss/backups/restore-schema.sql.gz
|
||||
|
||||
if [ -r $RESTORE_SCHEMA ]; then
|
||||
zcat $RESTORE_SCHEMA | $PSQL
|
||||
elif ! $PSQL -c 'select * from ttrss_version'; then
|
||||
$PSQL < /var/www/html/tt-rss/schema/ttrss_schema_pgsql.sql
|
||||
fi
|
||||
|
||||
SELF_URL_PATH=$(echo $SELF_URL_PATH | sed -e 's/[\/&]/\\&/g')
|
||||
|
||||
if [ ! -s $DST_DIR/config.php ]; then
|
||||
sed \
|
||||
-e "s/define('DB_HOST'.*/define('DB_HOST', '$DB_HOST');/" \
|
||||
-e "s/define('DB_USER'.*/define('DB_USER', '$DB_USER');/" \
|
||||
-e "s/define('DB_NAME'.*/define('DB_NAME', '$DB_NAME');/" \
|
||||
-e "s/define('DB_PASS'.*/define('DB_PASS', '$DB_PASS');/" \
|
||||
-e "s/define('DB_TYPE'.*/define('DB_TYPE', 'pgsql');/" \
|
||||
-e "s/define('DB_PORT'.*/define('DB_PORT', 5432);/" \
|
||||
-e "s/define('PLUGINS'.*/define('PLUGINS', 'auth_internal, note, nginx_xaccel');/" \
|
||||
-e "s/define('SELF_URL_PATH'.*/define('SELF_URL_PATH','$SELF_URL_PATH');/" \
|
||||
< $DST_DIR/config.php-dist > $DST_DIR/config.php
|
||||
|
||||
cat >> $DST_DIR/config.php << EOF
|
||||
define('NGINX_XACCEL_PREFIX', '/tt-rss');
|
||||
EOF
|
||||
else
|
||||
sed \
|
||||
-e "s/define('SELF_URL_PATH'.*/define('SELF_URL_PATH','$SELF_URL_PATH');/" \
|
||||
-i.bak $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
|
||||
|
@ -1,23 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
# 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 $DB_HOST -U $DB_USER; do
|
||||
echo waiting until $DB_HOST is ready...
|
||||
sleep 3
|
||||
done
|
||||
|
||||
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 -u app /usr/bin/php /var/www/html/tt-rss/update_daemon2.php
|
@ -1,3 +0,0 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
@ -1,59 +0,0 @@
|
||||
worker_processes auto;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
access_log /dev/stdout;
|
||||
error_log /dev/stderr warn;
|
||||
|
||||
sendfile on;
|
||||
|
||||
index index.php;
|
||||
|
||||
upstream app {
|
||||
server app:9000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
root /var/www/html;
|
||||
|
||||
location /tt-rss/cache {
|
||||
aio threads;
|
||||
internal;
|
||||
}
|
||||
|
||||
location /tt-rss/backups {
|
||||
internal;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
|
||||
# Check that the PHP script exists before passing it
|
||||
try_files $fastcgi_script_name =404;
|
||||
|
||||
# Bypass the fact that try_files resets $fastcgi_path_info
|
||||
# see: http://trac.nginx.org/nginx/ticket/321
|
||||
set $path_info $fastcgi_path_info;
|
||||
fastcgi_param PATH_INFO $path_info;
|
||||
|
||||
fastcgi_index index.php;
|
||||
include fastcgi.conf;
|
||||
|
||||
fastcgi_pass app;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{%HTTP_HOST%}
|
||||
tls ttrss@{%HTTP_HOST%}
|
||||
|
||||
root /var/www/html
|
||||
log stdout
|
||||
errors stderr
|
||||
internal /tt-rss/cache
|
||||
internal /tt-rss/backups
|
||||
fastcgi / app:9000 php
|
@ -1,4 +0,0 @@
|
||||
FROM abiosoft/caddy:no-stats
|
||||
|
||||
COPY Caddyfile /etc/
|
||||
ENV ACME_AGREE=true
|
@ -1,7 +0,0 @@
|
||||
0.0.0.0
|
||||
root /var/www/html
|
||||
log stdout
|
||||
errors stderr
|
||||
internal /tt-rss/cache
|
||||
internal /tt-rss/backups
|
||||
fastcgi / app:9000 php
|
@ -1,3 +0,0 @@
|
||||
FROM abiosoft/caddy:no-stats
|
||||
|
||||
COPY Caddyfile /etc/
|
Loading…
Reference in New Issue