From e43e239e34aa8ffe891e2e19dda37da0103fae6b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 30 Sep 2020 15:10:54 +0300 Subject: [PATCH] remove unused things from this branch build directory --- src/app/Dockerfile | 23 --------- src/app/backup.sh | 31 ------------ src/app/build-prepare.sh | 10 ---- src/app/dcron.sh | 5 -- src/app/index.php | 3 -- src/app/startup.sh | 92 ---------------------------------- src/app/updater.sh | 23 --------- src/docker-compose.yml | 104 +-------------------------------------- src/web-nginx/Dockerfile | 3 -- src/web-nginx/nginx.conf | 59 ---------------------- src/web-ssl/Caddyfile | 9 ---- src/web-ssl/Dockerfile | 4 -- src/web/Caddyfile | 7 --- src/web/Dockerfile | 3 -- 14 files changed, 1 insertion(+), 375 deletions(-) delete mode 100644 src/app/Dockerfile delete mode 100755 src/app/backup.sh delete mode 100755 src/app/build-prepare.sh delete mode 100755 src/app/dcron.sh delete mode 100644 src/app/index.php delete mode 100755 src/app/startup.sh delete mode 100755 src/app/updater.sh delete mode 100644 src/web-nginx/Dockerfile delete mode 100644 src/web-nginx/nginx.conf delete mode 100644 src/web-ssl/Caddyfile delete mode 100644 src/web-ssl/Dockerfile delete mode 100644 src/web/Caddyfile delete mode 100644 src/web/Dockerfile diff --git a/src/app/Dockerfile b/src/app/Dockerfile deleted file mode 100644 index 149d85c..0000000 --- a/src/app/Dockerfile +++ /dev/null @@ -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 diff --git a/src/app/backup.sh b/src/app/backup.sh deleted file mode 100755 index f13e720..0000000 --- a/src/app/backup.sh +++ /dev/null @@ -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 diff --git a/src/app/build-prepare.sh b/src/app/build-prepare.sh deleted file mode 100755 index 5e5a5c2..0000000 --- a/src/app/build-prepare.sh +++ /dev/null @@ -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 diff --git a/src/app/dcron.sh b/src/app/dcron.sh deleted file mode 100755 index b16f15a..0000000 --- a/src/app/dcron.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# https://github.com/dubiousjim/dcron/issues/13 -set -e - -/usr/sbin/crond "$@" diff --git a/src/app/index.php b/src/app/index.php deleted file mode 100644 index 78e5c3f..0000000 --- a/src/app/index.php +++ /dev/null @@ -1,3 +0,0 @@ - $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 - diff --git a/src/app/updater.sh b/src/app/updater.sh deleted file mode 100755 index 480a5d1..0000000 --- a/src/app/updater.sh +++ /dev/null @@ -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 diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 007d26f..e624c0b 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -16,108 +16,6 @@ services: - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_USER=${POSTGRES_USER} - app: - image: cthulhoo/ttrss-fpm-pgsql-static:${BUILD_TAG} - build: - context: - ./app - restart: unless-stopped - environment: - - DB_TYPE=pgsql - - DB_HOST=db - - DB_NAME=${POSTGRES_USER} - - DB_USER=${POSTGRES_USER} - - DB_PASS=${POSTGRES_PASSWORD} - - OWNER_UID=${OWNER_UID} - - OWNER_GID=${OWNER_GID} - - SELF_URL_PATH=${SELF_URL_PATH} - volumes: - - app:/var/www/html - depends_on: - - db - - updater: - image: cthulhoo/ttrss-fpm-pgsql-static:${BUILD_TAG} - build: - context: - ./app - restart: unless-stopped - environment: - - DB_TYPE=pgsql - - DB_HOST=db - - DB_NAME=${POSTGRES_USER} - - DB_USER=${POSTGRES_USER} - - DB_PASS=${POSTGRES_PASSWORD} - - OWNER_UID=${OWNER_UID} - - OWNER_GID=${OWNER_GID} - - SELF_URL_PATH=${SELF_URL_PATH} - volumes: - - app:/var/www/html - depends_on: - - app - command: /updater.sh - - backups: - image: cthulhoo/ttrss-fpm-pgsql-static:${BUILD_TAG} - build: - context: - ./app - restart: unless-stopped - environment: - - DB_TYPE=pgsql - - DB_HOST=db - - DB_NAME=${POSTGRES_USER} - - DB_USER=${POSTGRES_USER} - - DB_PASS=${POSTGRES_PASSWORD} - - OWNER_UID=${OWNER_UID} - - OWNER_GID=${OWNER_GID} - volumes: - - backups:/backups - - app:/var/www/html - depends_on: - - db - command: /dcron.sh -f - - web: - image: cthulhoo/ttrss-web:latest - build: ./web - restart: unless-stopped - ports: - - ${HTTP_PORT}:2015 - volumes: - - app:/var/www/html:ro - depends_on: - - app - - web-ssl: - image: cthulhoo/ttrss-web-ssl:latest - build: ./web-ssl - restart: unless-stopped - environment: - - CADDYPATH=/certs - - HTTP_HOST=${HTTP_HOST} - ports: - - 80:80 - - 443:443 - volumes: - - app:/var/www/html:ro - - certs:/certs - depends_on: - - app - - web-nginx: - image: cthulhoo/ttrss-web-nginx:latest - build: ./web-nginx - restart: unless-stopped - ports: - - ${HTTP_PORT}:80 - volumes: - - app:/var/www/html:ro - depends_on: - - app - volumes: db: - app: - certs: - backups: + diff --git a/src/web-nginx/Dockerfile b/src/web-nginx/Dockerfile deleted file mode 100644 index 9e620af..0000000 --- a/src/web-nginx/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM nginx:alpine - -COPY nginx.conf /etc/nginx/nginx.conf diff --git a/src/web-nginx/nginx.conf b/src/web-nginx/nginx.conf deleted file mode 100644 index 033f9da..0000000 --- a/src/web-nginx/nginx.conf +++ /dev/null @@ -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; - } - - } -} diff --git a/src/web-ssl/Caddyfile b/src/web-ssl/Caddyfile deleted file mode 100644 index 076829c..0000000 --- a/src/web-ssl/Caddyfile +++ /dev/null @@ -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 diff --git a/src/web-ssl/Dockerfile b/src/web-ssl/Dockerfile deleted file mode 100644 index 458a259..0000000 --- a/src/web-ssl/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM abiosoft/caddy:no-stats - -COPY Caddyfile /etc/ -ENV ACME_AGREE=true \ No newline at end of file diff --git a/src/web/Caddyfile b/src/web/Caddyfile deleted file mode 100644 index 19999ab..0000000 --- a/src/web/Caddyfile +++ /dev/null @@ -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 diff --git a/src/web/Dockerfile b/src/web/Dockerfile deleted file mode 100644 index 4d081e8..0000000 --- a/src/web/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM abiosoft/caddy:no-stats - -COPY Caddyfile /etc/