-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
86 lines (78 loc) · 2.51 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
FROM php:8.4-fpm-alpine3.21
LABEL maintainer="michal@sotolar.com"
ENV FRESHRSS_VERSION=1.25.0
ARG SHA256=01586fbbd1100d42205629ca3d5594193254b84b37fa4d0c7a97ced40e878a77
ADD https://github.com/FreshRSS/FreshRSS/archive/refs/tags/$FRESHRSS_VERSION.tar.gz /usr/src/freshrss.tar.gz
ENV PHP_MAX_EXECUTION_TIME 300
ENV PHP_MEMORY_LIMIT 32M
ENV DATA_PATH /usr/local/freshrss/data
WORKDIR /usr/local/freshrss
RUN set -ex; \
apk add --no-cache \
icu-data-full \
rsync \
tzdata \
; \
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
gmp-dev \
icu-dev \
libzip-dev \
openssl-dev \
postgresql-dev \
; \
docker-php-ext-install -j "$(nproc)" \
gmp \
intl \
opcache \
pgsql \
pdo_mysql \
pdo_pgsql \
zip \
; \
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-cache --virtual .freshrss-rundeps $runDeps; \
apk del --no-network .build-deps; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'session.auto_start=off'; \
echo 'session.gc_maxlifetime=21600'; \
echo 'session.gc_divisor=500'; \
echo 'session.gc_probability=1'; \
} > $PHP_INI_DIR/conf.d/session-defaults.ini; \
\
{ \
echo 'expose_php=off'; \
echo 'max_execution_time=${PHP_MAX_EXECUTION_TIME}'; \
echo 'memory_limit=${PHP_MEMORY_LIMIT}'; \
} > $PHP_INI_DIR/conf.d/freshrss-defaults.ini; \
echo "$SHA256 */usr/src/freshrss.tar.gz" | sha256sum -c -; \
rm -rf \
/usr/src/php.tar.xz \
/usr/src/php.tar.xz.asc \
/var/cache/apk/* \
/var/tmp/* \
/tmp/*
COPY resources/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY resources/exclude.txt /usr/src/freshrss.exclude
VOLUME /usr/local/freshrss/data
VOLUME /usr/local/freshrss/html/p
ENTRYPOINT ["entrypoint.sh"]
CMD ["php-fpm"]