Dockerfile 2.72 KB
Newer Older
1
FROM alpine:latest
2

3 4 5 6 7
MAINTAINER Michał "rysiek" Woźniak <rysiek@hackerspace.pl>
# original maintainer "Marvin Steadfast <marvin@xsteadfastx.org>"
# based on:
# - https://github.com/wallabag/docker
# - https://foss-notes.blog.nomagic.uk/2019/01/installing-wallabag-2-3-6-with-ldap-authentication/
Marvin Steadfast's avatar
Marvin Steadfast committed
8

9
ARG WALLABAG_VERSION=master
Marvin Steadfast's avatar
Marvin Steadfast committed
10

11
RUN set -ex \
12 13 14
 && apk update \
 && apk upgrade --available \
 && apk add \
Marvin Steadfast's avatar
Marvin Steadfast committed
15 16 17
      ansible \
      curl \
      git \
18
      libwebp \
Marvin Steadfast's avatar
Marvin Steadfast committed
19 20 21
      mariadb-client \
      pcre \
      php7 \
22
      php7-amqp \
23
      php7-bcmath \
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
      php7-ctype \
      php7-curl \
      php7-dom \
      php7-fpm \
      php7-gd \
      php7-gettext \
      php7-iconv \
      php7-json \
      php7-mbstring \
      php7-openssl \
      php7-pdo_mysql \
      php7-pdo_pgsql \
      php7-pdo_sqlite \
      php7-phar \
      php7-session \
39 40
      php7-simplexml \
      php7-tokenizer \
41 42
      php7-xml \
      php7-zlib \
43 44
      php7-sockets \
      php7-xmlreader \
Jorge Salamero Sanz's avatar
Jorge Salamero Sanz committed
45
      php7-tidy \
46
      php7-ldap \
Marvin Steadfast's avatar
Marvin Steadfast committed
47
      py-mysqldb \
48
      py-psycopg2 \
Marvin Steadfast's avatar
Marvin Steadfast committed
49
      py-simplejson \
50
      rabbitmq-c \
51
      tar \
52
      tzdata \
53
 && rm -rf /var/cache/apk/* \
54
 && curl -s https://getcomposer.org/installer | php \
55 56 57
 && mv composer.phar /usr/local/bin/composer

# clone the original repo
58 59
RUN git clone --branch $WALLABAG_VERSION --depth 1 https://github.com/wallabag/wallabag.git /var/www/wallabag

60
# prepare the LDAP patch (and clean up afterwards)
61 62 63 64 65 66 67 68
RUN PATCHTEMP=$( mktemp -d ) \
 && git clone https://git.immae.eu/github/wallabag/wallabag.git $PATCHTEMP \
 && cd $PATCHTEMP \
 && git checkout -t origin/gitolite_local/ldap \
 && git diff master -- . ':(exclude)app/config/wallabag.yml' ':(exclude).travis.yml' > /var/www/wallabag/wallabag-ldap.patch \
 && cd / \
 && rm -rf $PATCHTEMP

69 70 71 72 73 74 75 76 77
# prepare the Craue migrations patch
RUN PATCHTEMP=$( mktemp -d ) \
 && git clone --branch fix-3662 https://github.com/Nadrieril/wallabag.git $PATCHTEMP \
 && cd $PATCHTEMP \
 && git format-patch -3 --stdout > /var/www/wallabag/wallabag-craue-migrations.patch \
 && cd / \
 && rm -rf $PATCHTEMP

# apply all patches
78 79
RUN cd /var/www/wallabag/ \
 && patch -p1 -i wallabag-ldap.patch \
80 81 82 83
 && rm wallabag-ldap.patch \
 && git apply -v wallabag-craue-migrations.patch \
 && rm wallabag-craue-migrations.patch

Marvin Steadfast's avatar
Marvin Steadfast committed
84 85 86

COPY root /

87 88
RUN set -ex \
 && cd /var/www/wallabag \
89
 && sed -i -r -e 's/"config": \{/"config": {\n        "use-github-api": false,/' composer.json \
90
 && sed -i -r -e 's/"type": "vcs",/"type": "vcs",\n            "no-api": true,/' composer.json \
91
 && COMPOSER_MEMORY_LIMIT=-1 SYMFONY_ENV=prod composer install --no-dev -o --prefer-source --no-progress --no-interaction --verbose \
92
 && chown -R nobody:nobody /var/www/wallabag
Marvin Steadfast's avatar
Marvin Steadfast committed
93

94
EXPOSE 9000
Marvin Steadfast's avatar
Marvin Steadfast committed
95
ENTRYPOINT ["/entrypoint.sh"]
96
VOLUME ["/var/www/wallabag"]
Marvin Steadfast's avatar
Marvin Steadfast committed
97
CMD ["wallabag"]