forked from x86dev/docker-ttrss
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
56 lines (46 loc) · 2.1 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
# Using https://github.com/gliderlabs/docker-alpine,
# plus https://github.com/just-containers/s6-overlay for a s6 Docker overlay.
FROM docker.io/alpine:3 AS builder
# Initially was based on work of Christian Lück <[email protected]>.
LABEL description="A complete, self-hosted Tiny Tiny RSS (TTRSS) environment."
ARG S6_OVERLAY_VERSION=3.1.6.0
RUN set -xe && \
apk update && apk upgrade && \
apk add --no-cache --virtual=run-deps \
busybox nginx git ca-certificates curl \
php82 php82-fpm php82-phar php82-sockets php82-pecl-apcu \
php82-pdo php82-gd php82-pgsql php82-pdo_pgsql php82-xmlwriter php82-opcache \
php82-mbstring php82-intl php82-xml php82-curl php82-simplexml \
php82-session php82-tokenizer php82-dom php82-fileinfo php82-ctype \
php82-json php82-iconv php82-pcntl php82-posix php82-zip php82-exif \
php82-openssl sudo php82-pecl-xdebug rsync tzdata \
tar xz
RUN rm -f /usr/bin/php && \
ln -sf /usr/bin/php82 /usr/bin/php && \
rm -f /usr/sbin/php-fpm && \
ln -sf /usr/sbin/php-fpm82 /usr/sbin/php-fpm && \
rm -f /etc/init.d/php-fpm82
# Add user www-data for php-fpm.
# 82 is the standard uid/gid for "www-data" in Alpine.
RUN adduser -u 82 -D -S -G www-data www-data
# Copy root file system.
COPY --chown=www-data:www-data root /
# Add s6 overlay.
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
# Add wait-for-it.sh
ADD https://raw.githubusercontent.com/Eficode/wait-for/v2.2.4/wait-for /srv
RUN chmod 755 /srv/wait-for
# Expose Nginx ports.
EXPOSE 8080
EXPOSE 4443
# Expose default database credentials via ENV in order to ease overwriting.
ENV DB_NAME ttrss
ENV DB_USER ttrss
ENV DB_PASS ttrss
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME 0
# Clean up.
RUN set -xe && apk del --progress --purge && rm -rf /var/cache/apk/* && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["/init"]