bookstack/images/bookstack/Dockerfile

58 lines
1.6 KiB
Docker

FROM [[ .docker.repo ]][[ .docker.base_images.php82.image ]]
MAINTAINER [[ .docker.maintainer ]]
ARG BOOKSTACK_VERSION=[[ .bookstack.version ]]
ENV LANG=[[ .locale.lang ]] \
TZ=[[ .locale.tz ]] \
APP_ROOT=/app/public \
BOOKSTACK_INIT_DB=true \
WKHTMLTOPDF=/usr/local/bin/wkhtmltopdf \
APP_ENV=production \
APP_TIMEZONE='[[ .locale.tz ]]' \
SESSION_SECURE_COOKIE=true
USER root
COPY --from=[[ .docker.repo ]][[ .docker.base_images.wkhtmltopdf.image ]] /usr/local/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
RUN set -euxo pipefail &&\
apk add --no-cache \
php${PHP_VERSION}-tokenizer \
php${PHP_VERSION}-simplexml \
&&\
# For wkhtml2pdf \
apk add --no-cache \
libstdc++ \
libx11 \
libxrender \
libxext \
ca-certificates \
fontconfig \
freetype \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
&&\
apk add --no-cache --virtual .build-deps \
msttcorefonts-installer \
&&\
# Install microsoft fonts \
update-ms-fonts &&\
fc-cache -f &&\
# Clean up when done \
rm -rf /tmp/* &&\
apk del .build-deps &&\
curl -sSL https://github.com/BookStackApp/BookStack/archive/refs/tags/v${BOOKSTACK_VERSION}.tar.gz |\
tar xvz -C /app --strip-components 1 &&\
cd /app/ &&\
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev &&\
rm -rf storage bootstrap/cache public/uploads &&\
ln -sf /data/app/storage storage &&\
ln -sf /data/app/cache bootstrap/cache &&\
ln -s /data/app/uploads public/uploads
COPY root/ /
USER nginx