forked from solidnerd/docker-bookstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
94 lines (80 loc) · 3.12 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
87
88
89
90
91
92
93
94
FROM alpine:3 as bookstack
ENV BOOKSTACK_VERSION=23.12.1
RUN apk add --no-cache curl tar
RUN set -x; \
curl -SL -o bookstack.tar.gz https://github.com/BookStackApp/BookStack/archive/v${BOOKSTACK_VERSION}.tar.gz \
&& mkdir -p /bookstack \
&& tar xvf bookstack.tar.gz -C /bookstack --strip-components=1 \
&& rm bookstack.tar.gz
FROM php:8.3-apache-bookworm as final
RUN set -x; \
apt-get update \
&& apt-get install -y --no-install-recommends \
git \
zlib1g-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libldap2-dev \
libtidy-dev \
libxml2-dev \
fontconfig \
fonts-freefont-ttf \
wget \
tar \
curl \
libzip-dev \
unzip \
python3 \
python3-pip \
&& wget -O wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \
&& chmod a+x ./wkhtmltox.deb \
&& apt-get install -y ./wkhtmltox.deb \
&& rm ./wkhtmltox.deb \
&& docker-php-ext-install -j$(nproc) dom pdo pdo_mysql zip tidy \
&& docker-php-ext-configure ldap \
&& docker-php-ext-install -j$(nproc) ldap \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
RUN a2enmod rewrite remoteip; \
{ \
echo RemoteIPHeader X-Real-IP ; \
echo RemoteIPTrustedProxy 10.0.0.0/8 ; \
echo RemoteIPTrustedProxy 172.16.0.0/12 ; \
echo RemoteIPTrustedProxy 192.168.0.0/16 ; \
} > /etc/apache2/conf-available/remoteip.conf; \
a2enconf remoteip
RUN set -ex; \
sed -i "s/Listen 80/Listen 8080/" /etc/apache2/ports.conf; \
sed -i "s/VirtualHost *:80/VirtualHost *:8080/" /etc/apache2/sites-available/*.conf
COPY bookstack.conf /etc/apache2/sites-available/000-default.conf
COPY --from=bookstack --chown=33:33 /bookstack/ /var/www/bookstack/
ARG COMPOSER_VERSION=2.1.12
RUN set -x; \
cd /var/www/bookstack \
&& curl -sS https://getcomposer.org/installer | php -- --version=$COMPOSER_VERSION \
&& /var/www/bookstack/composer.phar install -v -d /var/www/bookstack/ \
&& rm -rf /var/www/bookstack/composer.phar /root/.composer \
&& chown -R www-data:www-data /var/www/bookstack
COPY php.ini /usr/local/etc/php/php.ini
COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
WORKDIR /var/www/bookstack
# www-data
USER 33
VOLUME ["/var/www/bookstack/public/uploads","/var/www/bookstack/storage/uploads"]
ENV RUN_APACHE_USER=www-data \
RUN_APACHE_GROUP=www-data
EXPOSE 8080
ENTRYPOINT ["/bin/docker-entrypoint.sh"]
ARG BUILD_DATE
ARG VCS_REF
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.docker.dockerfile="/Dockerfile" \
org.label-schema.license="MIT" \
org.label-schema.name="bookstack" \
org.label-schema.vendor="solidnerd" \
org.label-schema.url="https://github.com/solidnerd/docker-bookstack/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/solidnerd/docker-bookstack.git" \
org.label-schema.vcs-type="Git"