-
-
Notifications
You must be signed in to change notification settings - Fork 494
/
Dockerfile
145 lines (115 loc) · 5.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
FROM docker.io/alpine:3.19 AS builder
# Download ttrss via git
WORKDIR /var/www
# https://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
ADD https://gitlab.tt-rss.org/api/v4/projects/20/repository/branches/master /var/www/ttrss-version
RUN apk add --update tar curl git \
&& rm -rf /var/www/* \
&& git clone https://git.tt-rss.org/fox/tt-rss --depth=1 /var/www
# Download plugins
WORKDIR /var/www/plugins.local
## Fever
RUN mkdir /var/www/plugins/fever && \
curl -sL https://github.com/DigitalDJ/tinytinyrss-fever-plugin/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 -C /var/www/plugins/fever tinytinyrss-fever-plugin-master
## Mercury Fulltext
RUN mkdir mercury_fulltext && \
curl -sL https://github.com/HenryQW/mercury_fulltext/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 -C mercury_fulltext mercury_fulltext-master
## Feediron
RUN mkdir feediron && \
curl -sL https://github.com/feediron/ttrss_plugin-feediron/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 -C feediron ttrss_plugin-feediron-master
## OpenCC
RUN mkdir opencc && \
curl -sL https://github.com/HenryQW/ttrss_opencc/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 -C opencc ttrss_opencc-master
## News+ API
RUN mkdir api_newsplus && \
curl -sL https://github.com/voidstern/tt-rss-newsplus-plugin/archive/master.tar.gz | \
tar xzvpf - --strip-components=2 -C api_newsplus tt-rss-newsplus-plugin-master/api_newsplus
## FeedReader API
ADD https://raw.githubusercontent.com/jangernert/FeedReader/master/data/tt-rss-feedreader-plugin/api_feedreader/init.php api_feedreader/
## Options per feed
RUN mkdir options_per_feed && \
curl -sL https://github.com/sergey-dryabzhinsky/options_per_feed/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 -C options_per_feed options_per_feed-master
## Remove iframe sandbox
RUN mkdir remove_iframe_sandbox && \
curl -sL https://github.com/DIYgod/ttrss-plugin-remove-iframe-sandbox/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 -C remove_iframe_sandbox ttrss-plugin-remove-iframe-sandbox-master
## Wallabag
RUN mkdir wallabag_v2 && \
curl -sL https://github.com/joshp23/ttrss-to-wallabag-v2/archive/master.tar.gz | \
tar xzvpf - --strip-components=2 -C wallabag_v2 ttrss-to-wallabag-v2-master/wallabag_v2
## Auth OIDC
RUN mkdir auth_oidc && \
curl -sL https://gitlab.tt-rss.org/tt-rss/plugins/ttrss-auth-oidc/-/archive/master/ttrss-auth-oidc-master.tar.gz | \
tar xzvpf - --strip-components=1 -C auth_oidc ttrss-auth-oidc-master
## FreshAPI
RUN mkdir freshapi && \
curl -sL https://github.com/eric-pierce/freshapi/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 -C freshapi freshapi-master
# Download themes
WORKDIR /var/www/themes.local
# Fix safari: TypeError: window.requestIdleCallback is not a function
# https://community.tt-rss.org/t/typeerror-window-requestidlecallback-is-not-a-function/1755/26
# https://github.com/pladaria/requestidlecallback-polyfill
# COPY src/local-overrides.js local-overrides.js
# this polyfill is added to tt-rss after 1 years 7 months
# https://github.com/HenryQW/Awesome-TTRSS/commit/1b077f26f8c40ce7dd7b2a0cf2263a3537118e07
# https://gitlab.tt-rss.org/tt-rss/tt-rss/-/commit/31ef788e02339452fa6241277e17f85067c33ba0
## Feedly
RUN curl -sL https://github.com/levito/tt-rss-feedly-theme/archive/master.tar.gz | \
tar xzvpf - --strip-components=1 --wildcards -C . tt-rss-feedly-theme-master/feedly*.css tt-rss-feedly-theme-master/feedly/fonts
## RSSHub
RUN curl -sL https://github.com/DIYgod/ttrss-theme-rsshub/archive/master.tar.gz | \
tar xzvpf - --strip-components=2 -C . ttrss-theme-rsshub-master/dist/rsshub.css
FROM docker.io/alpine:3.19
LABEL maintainer="Henry<[email protected]>"
WORKDIR /var/www
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
COPY src/wait-for.sh /wait-for.sh
COPY src/ttrss.nginx.conf /etc/nginx/nginx.conf
COPY src/initialize.php /initialize.php
COPY src/s6/ /etc/s6/
# Open up ports to bypass ttrss strict port checks, USE WITH CAUTION
ENV ALLOW_PORTS="80,443"
ENV SELF_URL_PATH http://localhost:181
ENV DB_NAME ttrss
ENV DB_USER ttrss
ENV DB_PASS ttrss
# Install dependencies
RUN chmod -x /wait-for.sh && chmod -x /docker-entrypoint.sh && apk add --update --no-cache git nginx s6 curl sudo \
php81 php81-fpm php81-phar php81-sockets php81-pecl-apcu \
php81-pdo php81-gd php81-pgsql php81-pdo_pgsql php81-xmlwriter php81-opcache \
php81-mbstring php81-intl php81-xml php81-curl php81-simplexml \
php81-session php81-tokenizer php81-dom php81-fileinfo php81-ctype \
php81-json php81-iconv php81-pcntl php81-posix php81-zip php81-exif php81-openssl \
php81-gmp php81-pecl-imagick \
ca-certificates && rm -rf /var/cache/apk/* \
# Update libiconv as the default version is too low
# Do not bump this dependency https://gitlab.alpinelinux.org/alpine/aports/-/issues/12328
&& apk add gnu-libiconv=1.15-r3 --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ \
&& rm -rf /var/www \
&& ln -s /usr/bin/php81 /usr/bin/php
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
# Copy TTRSS and plugins
COPY --from=builder /var/www /var/www
RUN chown nobody:nginx -R /var/www \
&& git config --global --add safe.directory /var/www
EXPOSE 80
# Database default settings
ENV DB_HOST=database.postgres
ENV DB_PORT=5432
ENV DB_USER=postgres
ENV DB_PASS=ttrss
ENV DB_NAME=ttrss
# Some default settings
ENV SELF_URL_PATH=http://localhost:181
ENV ENABLE_PLUGINS=auth_internal,fever
ENV SESSION_COOKIE_LIFETIME=24
ENV SINGLE_USER_MODE=false
ENV LOG_DESTINATION=sql
ENV FEED_LOG_QUIET=false
ENTRYPOINT ["sh", "/docker-entrypoint.sh"]