bookstack-ppm/app/Dockerfile

85 lines
2.2 KiB
Docker
Raw Normal View History

2018-06-10 14:13:09 +00:00
FROM alpine:edge
2019-05-08 12:04:15 +00:00
LABEL maintainer="JJTC <docker@jjtc.eu>"
2018-06-10 14:13:09 +00:00
2019-05-08 12:04:15 +00:00
ENV PPM_VERSION=2.0.0 \
2019-07-22 16:33:49 +00:00
PPM_HTTP_VERSION=2.0.2 \
2018-06-10 14:13:09 +00:00
BOOKSTACK=BookStack \
2019-06-11 14:25:43 +00:00
BOOKSTACK_VERSION=0.26.3 \
2018-06-10 14:13:09 +00:00
BOOKSTACK_HOME="/app"
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
RUN set -ex \
&& chmod +x /app/docker-entrypoint.sh \
# ensure www-data user exists
# 82 is the standard uid/gid for "www-data" in Alpine
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data \
&& apk update \
&& echo "Setting up PHP extensions" \
&& apk add --no-cache \
bash \
curl \
su-exec \
nginx \
tar \
php7 \
php7-cgi \
php7-ctype \
php7-curl \
php7-dom \
php7-exif \
php7-fileinfo \
php7-gd \
php7-iconv \
php7-intl \
php7-json \
php7-ldap \
php7-mbstring \
php7-mcrypt \
php7-opcache \
php7-openssl \
php7-pcntl \
php7-pdo_mysql \
2019-05-08 12:04:15 +00:00
php7-pecl-imagick \
2018-06-10 14:13:09 +00:00
php7-phar \
php7-posix \
php7-redis \
php7-session \
php7-simplexml \
php7-sockets \
php7-tidy \
php7-tokenizer \
php7-xml \
php7-xmlwriter \
php7-zip \
php7-zlib \
composer \
&& echo "Setting up PPM:" \
&& mkdir -p /ppm/run \
&& cd /ppm \
&& chmod -R 777 run/ \
2019-05-08 12:04:15 +00:00
&& composer require php-pm/php-pm:${PPM_VERSION} php-pm/httpkernel-adapter:${PPM_HTTP_VERSION} \
2018-06-10 14:13:09 +00:00
&& echo "Get BookStack:" \
&& mkdir -p ${BOOKSTACK_HOME} \
&& cd ${BOOKSTACK_HOME} \
&& curl -LJO https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz \
&& tar --strip-components=1 -xzf BookStack-${BOOKSTACK_VERSION}.tar.gz \
&& rm -rf ${BOOKSTACK}-${BOOKSTACK_VERSION}.tar.gz .env.example .gitattributes .github .gitignore .travis.yml tests/ public/index.php \
&& ln -s init.php bootstrap/autoload.php \
2018-06-10 14:13:09 +00:00
&& echo "Get Dependencies:" \
&& composer install \
&& echo "Changing ownership:" \
&& chown www-data:www-data -R . \
2019-05-08 12:04:15 +00:00
&& echo "Ensure Nginx got access to tmp folder:" \
&& chown www-data:www-data -R /var/lib/nginx/tmp
2018-06-10 14:13:09 +00:00
WORKDIR $BOOKSTACK_HOME
EXPOSE 80
VOLUME ["$BOOKSTACK_HOME/public/uploads", "$BOOKSTACK_HOME/public/storage"]
ENTRYPOINT ["./docker-entrypoint.sh"]