diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e46e3b4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git +.git* +.drone.* +*.md +.dockerignore +Dockerfile +Dockerfile.* +docker-compose.yml diff --git a/Dockerfile.linux.amd64 b/Dockerfile.linux.amd64 index 3bc1e5f..e839b6f 100644 --- a/Dockerfile.linux.amd64 +++ b/Dockerfile.linux.amd64 @@ -1,25 +1,22 @@ FROM alpine:3.10.0 -ARG TTRSS_VERSION -ARG TTRSS_TARBALL=https://git.tt-rss.org/git/tt-rss/archive/${TT_RSS_VERSION}.tar.gz -ARG TTRSS_MASTER=https://git.tt-rss.org/fox/tt-rss.git +ARG TTRSS_VERSION=master +ARG TTRSS_TARBALL=https://git.tt-rss.org/git/tt-rss/archive/${TTRSS_VERSION}.tar.gz -RUN apk update && \ - apk add gomplate openssl unzip nginx bash git ca-certificates s6 curl ssmtp mailx php7 php7-curl \ +RUN apk --update add --virtual .build-deps tar curl && \ + apk --update add s6 nginx ca-certificates ssmtp mailx php7 php7-curl \ php7-fpm php7-xml php7-dom php7-opcache php7-iconv php7-pdo php7-pdo_mysql php7-mysqli php7-mysqlnd \ php7-pdo_pgsql php7-pgsql php7-gd php7-mcrypt php7-posix php7-ldap php7-json php7-mbstring \ php7-session php7-fileinfo php7-intl php7-pcntl && \ - rm -rf /var/cache/apk/* && \ rm -rf /var/www/localhost && \ rm -f /etc/php7/php-fpm.d/www.conf && \ mkdir -p /var/www/app && \ - if [ -z ${TTRSS_VERSION+x} ]; then \ - git clone ${TTRSS_MASTER} /var/www/app; \ - else \ - curl -o /tmp/ttrss.tar.gz -L ${TTRSS_TARBALL}.tar.gz && \ - tar xf /tmp/ttrss.tar.gz -C /var/www/app/ --strip-components=1 && \ - rm -rf /tmp/*; \ - fi + curl -SsL -o /usr/local/bin/gomplate https://github.com/hairyhenderson/gomplate/releases/download/v3.5.0/gomplate_linux-amd64-slim && \ + chmod 755 /usr/local/bin/gomplate && \ + curl -SsL ${TTRSS_TARBALL} | tar xz -C /var/www/app/ --strip-components=1 && \ + apk del .build-deps && \ + rm -rf /var/cache/apk/* && \ + rm -rf /tmp/* ADD overlay/ / diff --git a/docker-compose.yml b/docker-compose.yml index 7e83eb7..c7277d2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,9 @@ services: image: xoxys/ttrss:latest ports: - "80:80" - + depends_on: + - db + db: image: postgres environment: diff --git a/manifest.tmpl b/manifest.tmpl index 9432bff..3db4778 100644 --- a/manifest.tmpl +++ b/manifest.tmpl @@ -6,8 +6,7 @@ tags: {{/each}} {{/if}} manifests: - - - image: xoxys/ttrss:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + - image: xoxys/ttrss:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 platform: architecture: amd64 os: linux diff --git a/overlay/usr/local/bin/entrypoint.sh b/overlay/usr/local/bin/entrypoint.sh index 50f1b03..abd1362 100755 --- a/overlay/usr/local/bin/entrypoint.sh +++ b/overlay/usr/local/bin/entrypoint.sh @@ -1,7 +1,6 @@ -#!/bin/bash - -/usr/bin/gomplate -V -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl -/usr/bin/gomplate -V -o /var/www/app/config.php -f /etc/templates/config.php.tmpl +#!/bin/sh +/usr/local/bin/gomplate -V -o /etc/php7/php.ini -f /etc/templates/php.ini.tmpl +/usr/local/bin/gomplate -V -o /var/www/app/config.php -f /etc/templates/config.php.tmpl chown -R nginx:nginx /var/www/app/lock chown -R nginx:nginx /var/www/app/cache